open file in notepad via gui
22 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hellow, i search a method to open a file in notepad or another simple txt reader from a gui. So my code generates a ascii file and if i push a button the file have to open notepad. my ascii file is: a = sinogram.sin;
if have found open('a');
but then it opens in matlab itself. Thx
0 Kommentare
Akzeptierte Antwort
Paulo Silva
am 21 Apr. 2011
Example:
!notepad C:\Program Files\MyFolder\textFile.txt
Just replace that path with your own.
0 Kommentare
Weitere Antworten (2)
Fiboehh
am 21 Apr. 2011
3 Kommentare
Paulo Silva
am 21 Apr. 2011
The way you call uigetfile is wrong
[FileName,PathName] = uigetfile('*.sin','Select the .sin-file')
eval(['!notepad ' PathName FileName])
Paulo Silva
am 21 Apr. 2011
And another way for those who hate the eval function
system(['notepad ' PathName FileName])
Fiboehh
am 21 Apr. 2011
1 Kommentar
Paulo Silva
am 21 Apr. 2011
[FileName,PathName] = uigetfile('*.sin','Select the .sin-file')
if ischar(FileName)
%disp('file selected')
eval(['!notepad ' PathName FileName])
else
%disp('user canceled')
end
Siehe auch
Kategorien
Mehr zu Environment and Settings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!