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 Exchange에서 Fortran with MATLAB에 대해 자세히 알아보기

질문:

2015년 4월 30일

댓글:

2015년 5월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by