load matlab file to current workspace
古いコメントを表示
Hi,
I use this code to load .m file
[filename, pathname] = uigetfile( ...
{'*.m', 'All matlab-Files (*.m)'; ...
'*.*','All Files (*.*)'}, ...
'Select Matlab File');
save(fullfile(pwd, filename));
but! .. when i open it after loading, its content was changed to undefined character like this:
ه3"av خًOتJM.aà„ت?A?GB‰?JKـ2sR?sS‹!b?HْYذô3Bظ0s? ü¬ؤ”ش ¨™??ô³ èga?ِwٍ?és ڈ?ح^?ك%5/?³83/]/?,?
how i can save it with orginal content (matlab code)?
4 件のコメント
Honglei Chen
2011 年 12 月 15 日
Could you clarify exactly what you want to do? save command saves the workspace variables, not the file. Besides, you already have the file and what's the point to save it again? Do you mean you want to run the script and save the result?
Amani
2011 年 12 月 16 日
Fangjun Jiang
2011 年 12 月 16 日
To "add it to current directory too", use copyfile()
Amani
2011 年 12 月 19 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で App Building についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!