Carramba wrote: (snip)
> I'm real newby in fortran, and I can't get the print/Write routine...
> I'm trying to print a matrix but I can't even get the row to print on
> the same line.. my code result on a one long column..
> read(12,*) a Normally each WRITE/PRINT starts a new line.
> do i= 1,16
> do j=1,16
> print *, a(j)
> end do
> end do
> how do I write row on the same line? is it possible to somehow keep same It is not possible to format it the same as the input file, but
> format as it was in original file? (it's square matrix)
> I would like to the same print out no matter how big matrices I would use.
it is possible to print a square matrix. As list directed that would be:
That doesn't guarantee to put each row on the same line,
and it will also print it as the transpose of the matrix you
Reads columnwise, that is, a(1,1) a(2,1) a(3,1) ... a(16,1) a(1,2) ...
Will print elements in the same order as they were read in.
is more likely to print a square matrix, and will work even if you
increase the 16 up to 100. Since most printers aren't that wide,
I usually don't try that.
Will print two groups of eight columns each.
Reverse the subscripts to (j,i) if you want them
to come out the other way around.