【发布时间】:2009-05-03 23:25:35
【问题描述】:
非常简单的问题。
说我有
real, dimension(0:100) :: realResults
我想遍历realResults,最终创建表单数组的json
[[x1,y1], [x2,y2], [x3, y3], ... ]
我很确定我想使用“do”,但我不确定如何使用
谢谢
【问题讨论】:
非常简单的问题。
说我有
real, dimension(0:100) :: realResults
我想遍历realResults,最终创建表单数组的json
[[x1,y1], [x2,y2], [x3, y3], ... ]
我很确定我想使用“do”,但我不确定如何使用
谢谢
【问题讨论】:
在 Fortran 90 中,您可以像这样进行数组迭代:
do i = lbound(realResults), ubound(realResults)
! do something with realResults(i)
end do
【讨论】:
do i = lbound(columns_to_test, 1), ubound(columns_to_test, 1),否则得到Error: Start expression in DO loop at (1) must be a scalar
FORTRAN 和 json 在同一段中?!?!怎么回事? 可能是这样的:
do 10 i = 0, 100
C do something with realResults(i)
10 continue
【讨论】: