我编辑的matlab函数老是出现这种问题:Error using spirallength (line 9) Not enough input arguments.function varargout = spirallength(d,n,varargin)%SPIRAL \x09\x09\x09\x09\x09画出螺旋线或螺旋条带Nin = length(varargin) + 1;% erro

来源:学生作业帮助网 编辑:作业帮 时间:2024/12/04 17:14:04
我编辑的matlab函数老是出现这种问题:Error using spirallength (line 9) Not enough input arguments.function varargout = spirallength(d,n,varargin)%SPIRAL \x09\x09\x09\x09\x09画出螺旋线或螺旋条带Nin = length(varargin) + 1;% erro
xTn@aQ &XlĂdv<~ T)HEI+Q Y BL_`<8 PA(=9qfom;V.9Tև^ؼw 셣QћeXD 9tKl5 l[WcgUWd`pKH `iy3µ+^ n4ş?7/|1ۏogk~ as&|,+קtύpSK, O&xژ-HKl&u0@]·=b rp`kjԄr8#fL nRHΝʑO P&!,1Td$UT5@֡?MpOUb KD$gs3"eXA $lf20p!)ٺkIWQ*IRk';3 6@6W\R&2X xB3I lan!>=y}rT9*U-kA.@DiO_3n䝬B+dq#c<|=G>o|x{{|/oxo_Y77_[a>i%!ŜmJ%

我编辑的matlab函数老是出现这种问题:Error using spirallength (line 9) Not enough input arguments.function varargout = spirallength(d,n,varargin)%SPIRAL \x09\x09\x09\x09\x09画出螺旋线或螺旋条带Nin = length(varargin) + 1;% erro
我编辑的matlab函数老是出现这种问题:Error using spirallength (line 9) Not enough input arguments.
function varargout = spirallength(d,n,varargin)
%SPIRAL \x09\x09\x09\x09\x09画出螺旋线或螺旋条带
Nin = length(varargin) + 1;
% error(nargchk(1,Nin,nargin))
if nargout > 1
error('Too many output arguments!')
end
j = sqrt(-1);
phi = 0:pi/20 :n*2*pi;
amp = 0:d/40 :n*d;
spir = amp .* exp(j*phi);
if nargout==0
switch Nin
case 1
plot(spir,'b')
case 2
d1=varargin{1};
amp1 = (0:d/40 :n*d) + d1; spir1 = amp1 .* exp(j*phi);
plot(spir,'b');hold on;plot(spir1,'b');hold off
otherwise
d1=varargin{1};
amp1 = (0:d/40 :n*d) + d1; spir1 = amp1 .* exp(j*phi);
plot(spir,varargin{2:end});hold on;plot(spir1,varargin{2:end});
end;
axis('square')
else
phi0 = 0:pi/1000 :n*2*pi;
amp0 = 0:d/2000 :n*d;
spir0 = amp0 .* exp(j*phi0);
varargout{1} = sum(abs(diff(spir0)));
if Nin>1
d1=varargin{1};
amp1 = (0:d/2000 :n*d) + d1; spir1 = amp1 .* exp(j*phi);
varargout{2} = sum(abs(diff(spir1)));
end;
end

我编辑的matlab函数老是出现这种问题:Error using spirallength (line 9) Not enough input arguments.function varargout = spirallength(d,n,varargin)%SPIRAL \x09\x09\x09\x09\x09画出螺旋线或螺旋条带Nin = length(varargin) + 1;% erro
是说
spirallength
这个函数你在使用的时候,输入参数不够,.你怎么调用这个函数的