Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

How to output a matrix without changing to a new line?

$
0
0

For example

program main
integer m
complex cjj
complex matrix(3, 5)

cjj=(0.0, 1.0)
matrix(1, :)=2*cjj
matrix(2, :)=2+1*cjj
matrix(3, :)=5*cjj+6

open(16, file='data.txt')
do m=1, 3
write(16, *)matrix(m, :)
enddo
close(16)
end

The above code does not work well. What I want is that the data in the output file is the same as the dimension of the matrix.

For this case, the size of the matrix is 3*5. What I want is also there are 3 lines ,and each line has 5 values.


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>