无水1324 发表于 2009-5-8 21:07

回复 8楼 maigicku 的帖子

function Testf=s(x)
Testf=x+2;
end


这里面的end是不是要删除,还有后面的也是一样

ChaChing 发表于 2009-5-8 21:56

原帖由 无水1324 于 2009-5-8 21:07 发表 http://www.chinavib.com/forum/images/common/back.gif
function Testf=s(x)
Testf=x+2;
end
这里面的end是不是要删除,还有后面的也是一样
院长好眼力! 这个end有无皆可!
from matlab help

end also marks the termination of an M-file function, although in most cases, it is optional. end statements are required only in M-files that employ one or more nested functions. Within such an M-file, every function (including primary, nested, private, and subfunctions) must be terminated with an end statement. You can terminate any function type with end, but doing so is not required unless the M-file contains a nested function.

liushuiwuxin 发表于 2009-5-9 09:50

感谢各位的帮助!
页: 1 [2]
查看完整版本: 急求:函数间符号方程的调用问题