Passing 3D Array from Fortran to Matlab

  • Context: MATLAB 
  • Thread starter Thread starter Triscas
  • Start date Start date
  • Tags Tags
    3d Array Fortran
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 4K views
Triscas
Messages
9
Reaction score
0
Hello!

I'm working in a programm which has a 3D array with a DIMENSION(16,221,900). When I use the debugger option and I print out the value of the matrix I don't know how to read the info.

I already know Fortran uses column-major order, storing the columns in sequence.

My doubt is: How could I pass this temporary value of the array to Matlab?
 
on Phys.org
I don't exactly know what you are asking...does it have anything to do with fortran or not? or do you just don't know how to read a 3 dimensional matrix into matlab?

Not that I can help because I don't use matlab, but I will give the same advice I always give: "baby steps...baby steps".

So, first put together a small 3-D matrix you can memorize and recognize, like a 3x3x3 matrix with the numbers 1-9 in the first plane, and so on...

...can you read this into matlab?
in which format?
can you read it as a single vector and then reshape it inside?

Get creative, try stuff out, alternatives, etc,
 
gsal said:
So, first put together a small 3-D matrix you can memorize and recognize, like a 3x3x3 matrix with the numbers 1-9 in the first plane, and so on...

Or better, a 2x3x4 array, so you will know if you get the different dimensions (2, 3 and 4) in the wrong order for some reason.
 
Oh, that's a good, practical idea.

Just googled...found this.