matlab 写函数m文件时,最后的“return;”有什么用?其后面的分号有什么作用?
发布网友
发布时间:2022-05-26 21:08
我来回答
共2个回答
热心网友
时间:2023-11-02 01:32
就是返回咯
下面是帮助文档
MATLAB Function Reference rethrow (MException) rgb2hsv
Provide feedback about this page
return
Return to invoking function
Syntax
return
Description
return causes a normal return to the invoking function or to the keyboard. It also terminates keyboard mode.
Examples
If the determinant function were an M-file, it might use a return statement in handling the special case of an empty matrix, as follows:
function d = det(A)
%DET det(A) is the determinant of A.
if isempty(A)
d = 1;
return
else
...
end
See Also
break, continue, disp, end, error, for, if, keyboard, switch, while
Provide feedback about this page
rethrow (MException) rethrow (MException) rgb2hsv rgb2hsv
? 1984-2008 The MathWorks, Inc. ? Terms of Use ? Patents ? Trademarks ? Acknowledgments
热心网友
时间:2023-11-02 01:33
退出你不需要的