what this error mean

1 visualización (últimos 30 días)
faten emad
faten emad el 27 de En. de 2019
Respondida: madhan ravi el 28 de En. de 2019
plz what this error mean ?
Error: Function definitions are not permitted in this context.

Respuestas (2)

Star Strider
Star Strider el 27 de En. de 2019
It means that you need to save your function as a seprate function file (a ‘.m’ file with the same name as your function) on your MATLAB search path.
See the documentation on Function Basics (link) for a relevant discussion.

madhan ravi
madhan ravi el 28 de En. de 2019
When you are using version prior to 2016b a function definition cannot be included in a script (reason of your error) , therefore you need to save it in a separate file with the same name of a a function. Keep in mind you cannot paste a function in command window (in any versions of matlab).

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by