How to resolve this
4 次查看(过去 30 天)
显示 更早的评论
N1=function('N1')(t)
↑
Error: Function definitions are not supported in this context. Functions can only be created as local or nested functions in code files.
回答(1 个)
Taylor
2024-7-2
As stated, functions in MATLAB must be defined as:
function y = myFunc(x)
%% Do something
end
If the function is in a file by itself, the file name must be the function name. Terminating with an "end" statement is optional in this case. If the function is defined within a script, it may be placed anywhere as of R2024a.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dialog Boxes 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!