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....

 采纳的回答

James Tursa
James Tursa 2015-4-30
编辑:James Tursa 2015-4-30
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.

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Fortran with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by