John Knowles

11-14-2013, 03:04 PM

Suppose I create a 3D matrix:

dim_array=mxGetDimensions(prhs[0]);

Mat3DDoub NRstate3D(dim_array[0],dim_array[1],dim_array[2]);

I assumed I would be able to treat this as a matrix of matrices. However compiler complains when I try this:

ValApprox(NRstate3D[0],Params,ValFit[0],FlagVec,0);

where the header is:

Doub ValApprox(MatDoub NRstate,Parameters Params,MatDoub_O ValFit,FlagStruct FlagVec,int flag);

Am I doing it wrong, or is it simply not possible to treat a 3d matrix as a matrix of matrices?

dim_array=mxGetDimensions(prhs[0]);

Mat3DDoub NRstate3D(dim_array[0],dim_array[1],dim_array[2]);

I assumed I would be able to treat this as a matrix of matrices. However compiler complains when I try this:

ValApprox(NRstate3D[0],Params,ValFit[0],FlagVec,0);

where the header is:

Doub ValApprox(MatDoub NRstate,Parameters Params,MatDoub_O ValFit,FlagStruct FlagVec,int flag);

Am I doing it wrong, or is it simply not possible to treat a 3d matrix as a matrix of matrices?