我写了个函数,想在第二行插入个断点调试,无奈断点不起作用,不知道哪位同行指出问题所在?
多谢!
function [mag, angle] = polarvalue(x,y)
M=nargin; %想在此行插入断点
msg = nargchk(1,2,nargin);
error(msg); %报错,并终止运行函数
% If the y argument is missing, set it to 0.
if nargin < 2
y = 0;
end
% Check for (0,0) input argument, and print out
% a warning message.
if x == 0 & y == 0
msg = 'Both x and y are zero: angle is meaningless!';
warning(msg);
end
% Now calculate the magnitude
mag = sqrt(x .^2 + y .^2);
% If the second output argument is present,calculate
% angle in degrees
N=nargout;
if nargout == 2
angle = atan2(y,x) * 180/pi;
end
end


雷达卡


京公网安备 11010802022788号







