Question

I am going through someone's data analysis files (created in an older version of matlab) and trying to find out what a particular .mat file is that was used in a matlab script.

I am trying to load a .mat file in matlab. I want to see what is in it.

When I type...

load ('file.mat')

the file loads and I see two variables appear in the workspace. jobhelp and jobs.

When I try to open jobs by typing the following in the matlab command window...

jobs

the response is..

jobs =

[1x1 struct]

Does this mean that there is only a 1 x 1 structure in the .mat file? If so, how in the world do I see what it is? I'm even happy to load it in unix, but I don't know how to do that either. Any help would be greatly appreciated as I have a few files like this that I can't get any information from.

Again, a new user, so please make it simple.

Thanks

Was it helpful?

Solution

It means that jobs is a cell array {} and within this cell array is a structure defined

To see the structure and its contents type jobs{1}

OTHER TIPS

I think you are dealing with a SPM5 Batch-File. This variable is an image of the tree-like structure you can see in the Batch-Editor of SPM. Your job consists of one subitem (stats) which could have various subsubitems (like fMRI model specification, model estimation and so on).

To access this structure on the command line just proceed like Nick said:

  • Each level is a separate cell array that you can access with {#} after the name of the level. Example: jobs{1} shows you that there is a subitem named stats.
  • Subitems in structs are accessed with a dot. Example: jobes{1}.stats{1} shows you the subitems of the stats-entry.
  • Notice that there could be more than one entry on each layer: A stats module could (and probably would) contain various subitems. You can access them via jobs{1}.stat{2}, jobs{1}.stats{3} and so on.

The last layer would be the interesting one for you: The structures in here is an image of the options you can choose in the batch-editor.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top