帮个忙,看看什么问题
function y=jiecheng(a)if a=1
y=1
else
y=a*jiecheng(a-1)
end
y
??? Error: File: d:\MATLAB7\work\jiecheng.m Line: 3 Column: 5
The expression to the left of the equals sign is not a valid target for an assignment. 新手上路,麻烦大家了 function y=jiecheng(a)
if a==1;
y=1;
else
y=a*jiecheng(a-1);
end
y;
这样就可以了,少了个等号。 谢谢分享。。。 谢谢分享。。。
页:
[1]