Loading and using a .MAT file
1 次查看(过去 30 天)
显示 更早的评论
I am having a great deal of trouble saving a .MAT file to a destination on our D drive at the end of one function and retiriving it and loading its contents into the workspace at the start of another function. I am using
save D:\Temp_folder;
then at the beginning ....
load D:\Temp_folder
Do i need to use an append function?
Thank you for your help
0 个评论
采纳的回答
Paulo Silva
2011-6-15
Try like this:
save('D:\Temp_folder\MyVars')
load('D:\Temp_folder\MyVars')
Also you can use the save function with appended strings like this
save(['D:\Temp_folder\') 'MyVars'])
0 个评论
更多回答(2 个)
Gerd
2011-6-15
Hi William,
you have to use
% to save a file called "filename" in the folder "D:\Temp_folder"
save('D:\Temp_folder\filename');
% now you find the file with all variables from the workspace
The load command is just the other way around.
Gerd
0 个评论
SIIT
2011-9-11
Hi, I have problem of execute m file by using data in mat file. I have save my data in mat file as matrix form with specific name.
when I write my m file. why I can't use that data mat file in my m file?
Please help...
Thanks in advance!!!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!