Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Fortran 3D array

  1. Oct 4, 2013 #1

    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?
  2. jcsd
  3. Oct 4, 2013 #2
    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,
  4. Oct 4, 2013 #3


    User Avatar
    Science Advisor
    Homework Helper

    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.
  5. Oct 4, 2013 #4
    Oh, that's a good, practical idea.

    Just googled...found this.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook