load a matlab file
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Image Analyst
2013-1-24
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 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!