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 日

0 投票

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 ExchangeFortran with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by