load a matlab file

2 次查看(过去 30 天)
Rica
Rica 2013-1-24
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 个评论
Azzi Abdelmalek
Azzi Abdelmalek 2013-1-24
Have you any error message when you type: load('All_data') ?

请先登录,再进行评论。

采纳的回答

Image Analyst
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 个)

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by