Info
此问题已关闭。 请重新打开它进行编辑或回答。
Function definitions are not permitted in this context.
1 次查看(过去 30 天)
显示 更早的评论
% minutiae function consists logic to check bifurcation and termination points function y=minutie(x) i=ceil(size(x/2)); if x(i,i)==0; y=0; else y=sum(x(:))-1; end
0 个评论
回答(1 个)
Jan
2016-3-11
Functions can be defined in "function files" only: Files which start with the expression "function". There you can define a main function (called as the file), sub-functions, which are visible for the main-function also, and nested functions, which are visible for the parent function.
You cannot define functions inside scripts (M-files which donot start with "function") or in the command line.
Note: This topic has been discussed repeatedly and searchuing in the forum or the internet for the error message would reveal a solution very fast.
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!