My problem is regarding reshaping arrays in Matlab.
I am reading in Matlab the "diegm.MAT" file from Fortran. The size of this array is 12x3, and I need a 4x3x3.
I tried the reshape function but does not work.
This is the array that I am reading:
 5     2     5
 2     1     2
 4     3     2
 5     3     3
 5     2     4
 4     2     3
 1     1     3
 4     5     1
 3     3     1
 2     1     4
 2     3     1
 4     2     4
And this is the array that I need:
val(:,:,1) =
 5     1     2
 2     2     5
 5     4     3
 2     3     3
val(:,:,2) =
 5     2     3
 2     3     4
 4     1     5
 4     1     1
val(:,:,3) =
 3     1     1
 3     4     4
 1     2     2
 2     3     4
Here you can get the .MAT file that I transfer to Fortran.
 
     
    