如何将fortran goto状态翻译为matlab [英] How to translate fortran goto state to matlab

查看:380
本文介绍了如何将fortran goto状态翻译为matlab的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将goto状态(fortran)转换为matlab?

这意味着,如果NOPN等于1,实现第1行,

NOPN等于2,实现第2行?

How to convert goto state(fortran) to matlab?
That means, if NOPN is equal 1, implement line 1,
NOPN is equal 2, implement line 2?

 subroutine VECT(N1,N2,N3,NOPN)

 COMMONS WORMX(3,24), QVALU,DJACB

   I1=N1
   GO TO (1,2,3,4,5),NOPN
 1 I1=N2
 2 QVALU=0.0
   DO 10 I=1=3
10 QVALU=QVALU+WORMX(I,N1)*WORMX(I,I1)


推荐答案

是的,你已经知道了。这是一个计算转换 - 来自非常古老的FORTRAN - 现在已被弃用。行号不一定是 1,2,3 ... 。它们可以是任何有效的行号......从列表中选择第N个。

Yes, you have figured it out. This is a "computed goto" -- from very old FORTRAN -- now deprecated. The line numbers don't have to be 1,2,3.... They can be any valid line number ... the Nth is selected from the list.

这篇关于如何将fortran goto状态翻译为matlab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆