help using Save and load function
古いコメントを表示
Hello I would like to save a variable into a .dat file using the command window but my save function is now working. I have followed the example from my tutorial book but they are not working.
I would like to save the file and then load it again from the command window. I am currently using R2010a.
all assistance is greatly appreciated thank you
4 件のコメント
Geoff Hayes
2014 年 8 月 20 日
oselu - please clarify what you mean by they are not working. What errors or warnings are you observing? What example are you following? Please include the code.
oselu
2014 年 8 月 20 日
oselu
2014 年 8 月 20 日
oselu
2014 年 8 月 20 日
回答 (1 件)
Max Müller
2014 年 8 月 20 日
編集済み: Max Müller
2014 年 8 月 20 日
I had this Problem once before (i guess). Try to save ur Variable in a .mat file and then load it again. Just try it. Loading form a .dat file is somehow complicated.
X = 1
save('Test.mat','X') % save into the file: Test.mat
clear % deletes all the Variables it the Workspace
load('Test.mat','X') % gives back ur Variable X
5 件のコメント
Adam
2014 年 8 月 20 日
You might want to insert just
clear X
in the middle of there instead of 'clear' in case you try it in the middle of a workspace you don't want to lose!
Apart from that I would agree that .mat files are ideal for saving and reloading into Matlab itself.
oselu
2014 年 8 月 20 日
oselu
2014 年 8 月 20 日
oselu
2014 年 8 月 20 日
oselu
2014 年 8 月 20 日
カテゴリ
ヘルプ センター および 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!