- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page