Could I ask whether this is any Fortran funtion like the function linspace() in matlab? Or I need to implement it by myself. Thanks.
1 解答
Quoting - yingwu
Could I ask whether this is any Fortran funtion like the function linspace() in matlab? Or I need to implement it by myself. Thanks.
You could use an array construct. Something along the lines of :
real y(100)
real a
integer i
a = 1.5 ! Initial value
y = (/((i*a),i=1,100)/) ! assign to y in increments of 1.5 starting at 1.5
Les
链接已复制
2 回复数
Quoting - yingwu
Could I ask whether this is any Fortran funtion like the function linspace() in matlab? Or I need to implement it by myself. Thanks.
You could use an array construct. Something along the lines of :
real y(100)
real a
integer i
a = 1.5 ! Initial value
y = (/((i*a),i=1,100)/) ! assign to y in increments of 1.5 starting at 1.5
Les
Quoting - Les Neilson
You could use an array construct. Something along the lines of :
real y(100)
real a
integer i
a = 1.5 ! Initial value
y = (/((i*a),i=1,100)/) ! assign to y in increments of 1.5 starting at 1.5
Les
Thanks so much. It is very helpful.