open file in notepad via gui
27 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Paulo Silva
2011-4-21
Example:
!notepad C:\Program Files\MyFolder\textFile.txt
Just replace that path with your own.
0 个评论
更多回答(2 个)
Fiboehh
2011-4-21
3 个评论
Paulo Silva
2011-4-21
The way you call uigetfile is wrong
[FileName,PathName] = uigetfile('*.sin','Select the .sin-file')
eval(['!notepad ' PathName FileName])
Paulo Silva
2011-4-21
And another way for those who hate the eval function
system(['notepad ' PathName FileName])
Fiboehh
2011-4-21
1 个评论
Paulo Silva
2011-4-21
[FileName,PathName] = uigetfile('*.sin','Select the .sin-file')
if ischar(FileName)
%disp('file selected')
eval(['!notepad ' PathName FileName])
else
%disp('user canceled')
end
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String Parsing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!