load a matlab file
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi!
i have big data and i saved it in a mat file named All_data.
%
save('All_data','data1','data2','data3')
data1: [2970290x1 double]
data2: [2970290x1 double]
data3: {2970290x1 cell}
I want now to evalute the data in the file All_dat. Iused load('All_data'). But the data1, data2, data3 are not loadad.
should i load all of them with the load function, or there is any other smart method?
Thank you
1 Kommentar
Akzeptierte Antwort
Image Analyst
am 24 Jan. 2013
Try this
fullFileName = fullfile(pwd, 'All_data.mat');
if exist(fullFileName, 'file')
storedStructure = load(fullFileName)
data1 = storedStructure.data1
data2 = storedStructure.data2
data3 = storedStructure.data3
else
warningMessage = sprintf('Error: the file does not exist:\n%s', fullFileName);
uiwait(warndlg(warningMessage));
end
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu File Operations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!