- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I am working on a matrix and does anyone know how to print the matrix in format? For example, I have a 5*2 matrix stored in an array
real :: A(5,2)
I have used MKL to generate the matrix's values randomly. So I want to display this matrix, my code is
do i=1,5
print *, A(i,:)
end do
the output is like below,

However, when I use a third party library, the output looks better and nicer , as shown below

I want the below one, but I don't know how to do it. Could anybody help me? Thanks very much.
real :: A(5,2)
I have used MKL to generate the matrix's values randomly. So I want to display this matrix, my code is
do i=1,5
print *, A(i,:)
end do
the output is like below,
However, when I use a third party library, the output looks better and nicer , as shown below
I want the below one, but I don't know how to do it. Could anybody help me? Thanks very much.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
use a format
print '(f6.4,2x,f6.4)', a(i,:)
Les
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I also like the "es"scientific format to get a non-zero value as the first digit.
Perhaps something like:
print '(es12.4,2x,es12.4)', A(i,:)
Regards,
Greg
I also like the "es"scientific format to get a non-zero value as the first digit.
Perhaps something like:
print '(es12.4,2x,es12.4)', A(i,:)
Regards,
Greg

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