matlab提示:Incomplete or misformed expression or statement.function re = add_multi(a,b,c,d)% 输入:a,b,c,d% 输出:reif nargin == 4re = a + b + c + d;elseif nargin == 3re = a + b + c;elseif nargin == 2re = a + b;elseiferror('wrong')end调用

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/20 02:24:03
matlab提示:Incomplete or misformed expression or statement.function re = add_multi(a,b,c,d)% 输入:a,b,c,d% 输出:reif nargin == 4re = a + b + c + d;elseif nargin == 3re = a + b + c;elseif nargin == 2re = a + b;elseiferror('wrong')end调用
xK@{* )kL {K!6wh^ FϡeJe6UB{|^w{>hXMd9z8|m,)" 15/c * #GW5VDZ8_D9Q1IT5!#';ڗ#:n]xX-a0Q$bD rRi*ˤ6ْa d( ҲXpk\/{͸ufi7ma:f;a GYgC::*,bR௲&

matlab提示:Incomplete or misformed expression or statement.function re = add_multi(a,b,c,d)% 输入:a,b,c,d% 输出:reif nargin == 4re = a + b + c + d;elseif nargin == 3re = a + b + c;elseif nargin == 2re = a + b;elseiferror('wrong')end调用
matlab提示:Incomplete or misformed expression or statement.
function re = add_multi(a,b,c,d)
% 输入:a,b,c,d
% 输出:re
if nargin == 4
re = a + b + c + d;
elseif nargin == 3
re = a + b + c;
elseif nargin == 2
re = a + b;
elseif
error('wrong')
end
调用上面的函数文件时,matlab提示:
>> add_multi(1,2,3,4)
Error:File:C:\MATLAB7\work\add_multi.m Line:12 Column:7
Incomplete or misformed expression or statement.
能不能帮我看看问题出在哪里

matlab提示:Incomplete or misformed expression or statement.function re = add_multi(a,b,c,d)% 输入:a,b,c,d% 输出:reif nargin == 4re = a + b + c + d;elseif nargin == 3re = a + b + c;elseif nargin == 2re = a + b;elseiferror('wrong')end调用
最后一个elseif 改为else