Plotting matrix data in Matlab



As far as I’m concerned, if I want to visualize matrix data transferred from Lumerical in Matlab, I have to transpose (or permute) the matrix data due to the different convention about matrix structure between Lumerical and Matlab (KB contents). Could you give me some more detailed explanation about the matrix convention? I’m guessing the confusion as regards the transpose of the dataset in Matlab especially as the data sizes of x and y coordinates are the same would be alleviated by automatically transposing or permuting the data according to the matrix convention when user is putting out the data into Matlab or saving the data as Matlab format via matlabsave command.


If you have seen that KB article, you should have already noticed that the transpose is necessary if you would like to visualize the same plot in MATLAB. Or otherwise, you will see something like this, where the matrix is visualized 4x3 in Lumerical but 3x4 in MATLAB, and this is obviously not right unless you properly define the axes.

When we save the data using the matlabsave command, we are just putting the data in a .mat file. I am not 100% convinced that we should alter users’ data to a MATLAB format and it feels to me that it will be the users’ responsibility to convert it to MATLAB’s format, if they wish to do so.

Thank you for your feedback!