MATLAB Answers

"Function definitions are not permitted in this context."

1 view (last 30 days)
alpedhuez
alpedhuez on 15 Apr 2018
Answered: David Fletcher on 15 Apr 2018
I use R2017a and I got the above error message when trying to define a function in a script. Please advise.

  0 Comments

Sign in to comment.

Answers (1)

David Fletcher
David Fletcher on 15 Apr 2018
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

  0 Comments

Sign in to comment.

Sign in to answer this question.

Products