load matlab file to current workspace
Mostra commenti meno recenti
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 Commenti
Honglei Chen
il 15 Dic 2011
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
il 16 Dic 2011
Fangjun Jiang
il 16 Dic 2011
To "add it to current directory too", use copyfile()
Amani
il 19 Dic 2011
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su App Building in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!