What is the diffence between end and return in function ?

7 visualizaciones (últimos 30 días)
Hassan Al-Khateeb
Hassan Al-Khateeb el 15 de Mzo. de 2018
Respondida: James Tursa el 15 de Mzo. de 2018
What is the main differences between (end) and (return) (function) in MATLAB ?

Respuestas (1)

James Tursa
James Tursa el 15 de Mzo. de 2018
If the "end" you are talking about is the function end, then there is no difference. Both statements will cause a return to the caller and free any currently existing local variables. But of course the "return" statement can appear anywhere in the body of the function.

Categorías

Más información sobre Logical 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