开发者

display mat file in matlab

I want to display mat file's content to see all the results. I know that I can load it and then double click on it the content are display in the workspace, this case happen when the mat file content few information but when I have mat file content information for more than 13000 record I can't display it. could please any one help me to f开发者_运维知识库ind any way to display mat file as table?

thanks


I do not know the format of your data (multi-dimensional, structs, cell-arrays), but there is a function called "openvar" which can be very useful for these things.

Let's define a large random 500x500x10 3d-matrix:

large = rand(500,500,10);

This variable contains 2.5 million double-values and takes up close to 20MB of memory. Opening this in the variable editor by double click in the Workspace window on "large" will usually (atleast on my system) give the following message:

"Cannot display summaries of variables with more than 524288 elements."

But you can use the "openvar"-function to open certain parts:

openvar('large(:,:,1)'); %# pass the argument as a string.

This will open the first "layer" of matrices in your Variable Editor (a 500x500 matrix in this case). This is useful if you need to look into certain parts of a large variable.

Of course you can always define new variables that contain subsets of your larger variable:

less_large = large(:,:,1);

... and then open "less_large" in the variable editor by double clicking on it in the workspace-window. But sometimes the "openvar"-method is a bit faster/easier.


You have a few options. Starting from a clear workspace, you could load the mat file into the workspace. Anything now in the workspace is in the mat file. You can use the variable viewer or parse with scripts.

If you have the Simulink toolbox, you can use Simulink.saveVars to save the contents of the workspace to a human readable m-script that would generate the same contents. It's a shame that you need Simulink to do this, as this function has nothing to do with Simulink.


How about after loading the data, and use whos to display the variables in current workspace? Note that you may want to clear all the other variables before displaying them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜