saving all of workspace in a specified folder

saving all of workspace in a specified folder and after saving, how it can be import to MATLAB (load) from that specified folder?

 채택된 답변

TAB
TAB 2011년 9월 17일

4 개 추천

Saving to path
save('path\myfile.mat');
Example: save('D:\WORKING\Myfile.mat');
Loading from a path
load('path\myfile.mat');
Example: load('D:\WORKING\Myfile.mat');

댓글 수: 6

mohammad
mohammad 2011년 9월 17일
Thanks Tabrizi AZIZ :)
Sanat Dutta
Sanat Dutta 2013년 3월 11일
What if i want to save using a variable to a specific location.
For saving using a variable the command is: save(variable_name)
but when i tried saving as save('folder_location\variable_name')
it saves the workspace as 'variable_name' instead of the string value it has.
pls help.
Sanat Dutta
Sanat Dutta 2013년 3월 11일
nevermind, I got it :)
How did you do it?!
Almost 3 years and no answer :(
Emma_Mc
Emma_Mc 2016년 3월 3일
Include the location in the string for your variable name.
For example, you want to save a and b to the mat file 'variable_a_1_variable_b_2' in a folder 'save_test'.
a=1;
b=2;
variable_name=['D:\save_here\variable_a_',num2str(a),'variable_b_',num2str(b),'.mat'];
save(variable_name,'a','b');

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기

질문:

2011년 9월 17일

댓글:

2016년 3월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by