Extract variables from multiple .mat files

1 Ansicht (letzte 30 Tage)
Angela Bowman
Angela Bowman am 15 Sep. 2011
I have ~250 *.mat files in a year with ~25 variables in each file. I need to extract 1 variable from all of the files and create a new *.mat file to validate against other data.
What is the best way to solve this?

Antworten (2)

Fangjun Jiang
Fangjun Jiang am 15 Sep. 2011
My code in this answer could be used for your task too. Take a look to see if you have further questions. Basically, you need to go through a for-loop looping on your ~250 .mat files, taking one variable at a time.
  4 Kommentare
Angela Bowman
Angela Bowman am 16 Sep. 2011
Lat_coord(222,46);
Lon_coord(364,113);
x_value - let's call it 275 for example - is determined from Lat Lon, but the cell in variable "x_value" is unknown.
Matrix is 407X308, assume all other values NaN.
Fangjun Jiang
Fangjun Jiang am 16 Sep. 2011
So how do you pick the value then?

Melden Sie sich an, um zu kommentieren.


Walter Roberson
Walter Roberson am 15 Sep. 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by