I have 12 mat files (one for each month) that need to be used individually for a calculation. They are too big to load all twelve at one time. There fore I would like to call month #1, do the calculation, call month #2, ...#12.
I have done this with .asc files in the past, but am having trouble with. mat files.
I am trying the following:
matObj = matfile('tempOR_norm.mat')
matObj =
matlab.io.MatFile
Properties:
Properties.Source: 'C:\GIS_DATA\SNOW\Programs\SNOW\tempOR_norm.mat'
Properties.Writable: false
tempOR_01_norm: [1424x1817 double]
tempOR_02_norm: [1424x1817 double]
tempOR_03_norm: [1424x1817 double]
tempOR_04_norm: [1424x1817 double]
tempOR_05_norm: [1424x1817 double]
tempOR_06_norm: [1424x1817 double]
tempOR_07_norm: [1424x1817 double]
tempOR_08_norm: [1424x1817 double]
tempOR_09_norm: [1424x1817 double]
tempOR_10_norm: [1424x1817 double]
tempOR_11_norm: [1424x1817 double]
tempOR_12_norm: [1424x1817 double]
But how do I loop through this list?
I need something along the lines of
input = load(matObj(i))
but this give me:
MatFile objects are scalar. Access variables using the syntax objName.varName(indices).
Any insight would be appreciated!
-Thanks-
Got it (with help from Loop for loading and saving .mat files):
it goes like this...