open file in notepad via gui
조회 수: 22 (최근 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!