"Function definitions are not permitted in this context."

1 次查看(过去 30 天)
I use R2017a and I got the above error message when trying to define a function in a script. Please advise.

回答(1 个)

David Fletcher
David Fletcher 2018-4-15
If you have a function in a script (allowed from R2016 onwards I think), it must go at the end, after all the script code

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by