load matlab file to current workspace
Mostrar comentarios más antiguos
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 comentarios
Honglei Chen
el 15 de Dic. de 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
el 16 de Dic. de 2011
Fangjun Jiang
el 16 de Dic. de 2011
To "add it to current directory too", use copyfile()
Amani
el 19 de Dic. de 2011
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre App Building en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!