LoginSignup
0
0

More than 5 years have passed since last update.

Fortranの配列に要素を直接代入

Last updated at Posted at 2016-03-28

fortranでは(/ /)を使うことで直接配列に要素を代入できる

行に代入

1行目に1,2,3,4,5,6,7を代入

B(1,:) = (/ 1, 2, 3, 4, 5, 6, 7 /)

列に代入

1列目に1,2,3を代入

B(:,1) = (/ 1, 2, 3/)

変数を使った代入

B(1,:) = (/ (i,i = 1, 7) /)

参考資料

Nag 12 配列

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0