フィルターのクリア

how to popup or display saved text file in matlab.?

8 ビュー (過去 30 日間)
Nimisha
Nimisha 2015 年 1 月 2 日
コメント済み: Geoff Hayes 2022 年 11 月 3 日
In GUI when i click on some button, then text file which is already exist in directory should open. I searched in matlab help, but i can find only about to create and save text file only. There is no any command which pop up saved text file.!
Please provide a code or command which does this function..?

採用された回答

Geoff Hayes
Geoff Hayes 2015 年 1 月 2 日
Nimisha - what do you mean by popup saved text file? Do you want to open the MATLAB editor so that you can view the file, or some other editor, or ..?
If you just want to open the text file in the editor of your choice, then you can try using the system function. For example, if I wish to open a text file using TextEdit (on a Mac), I could execute the following statement in the MATLAB Command Window
system(['open -a TextEdit ' fullfile(pwd,'myOutput.txt')])
Note that I use fullfile to build the full path to the text file named myOutput.txt. The complete string that I pass to system is
['open -a TextEdit ' fullfile(pwd,'myOutput.txt')]
ans =
open -a TextEdit /Users/geoff/matlab/testing2/myOutput.txt
Try the above and see what happens!
  5 件のコメント
Avinash Dubey
Avinash Dubey 2022 年 11 月 1 日
How can we do this in a Windows , As open doesent apper to work in window 11
Geoff Hayes
Geoff Hayes 2022 年 11 月 3 日
See previous comment. Perhaps
system('notepad C:\Users\admin\Desktop\Passport.txt');
will work for you on Windows.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by