How to convert this FORTRAN code in to Matlab code

Hi guys, I am having problems converting this Fortran code in Matlab
_if (test.lt.temp)then
check=.false.
return
end if_
this " if loop " is inside a " Do loop "
I can understand that " end if " ends the if loop but why is there a " return " statement? someone pls help....

 Respuesta aceptada

James Tursa
James Tursa el 30 de Abr. de 2015
Editada: James Tursa el 30 de Abr. de 2015

0 votos

The return statement in Fortran does the same thing as the return statement in MATLAB ... it immediately exits the routine and returns to the calling routine. You can leave that line exactly as written.
One issue you might run into with an early return like this in MATLAB is potentially not having the output variables set. So you may have to add some dummy code for this in MATLAB to avoid "output variables not set" warnings in MATLAB.

Más respuestas (0)

Categorías

Más información sobre Fortran with MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 30 de Abr. de 2015

Comentada:

el 1 de Mayo de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by