How to include txt file on standalone app by app designer.

6 ビュー (過去 30 日間)
Jae-Hee Park
Jae-Hee Park 2021 年 10 月 8 日
編集済み: zz17635 2024 年 9 月 27 日
Hi
I am making a app using by app designer which read txt file and display values.
I am using this code.
function Data = array(filepath)
arguments
filepath = '../textfile/text.txt';
end
Data = readmatrix(filepath);
end
But when I make a standalone app, I don't know how to include text.txt file.
please let me know how to include text.txt file on standalone app and how to read it.

採用された回答

Cris LaPierre
Cris LaPierre 2021 年 10 月 8 日
I think you should be able to use the application compiler and include your text file in the 'Files your app needs in order to run' section. You can then write your app assuming the file will be in the current folder. You do not need to include a path to the file. You would just use the name.
  2 件のコメント
Jae-Hee Park
Jae-Hee Park 2021 年 10 月 9 日
Thankyou
zz17635
zz17635 2024 年 9 月 27 日
編集済み: zz17635 2024 年 9 月 27 日
Thank you, I was including a piece of code that tries to read the current file path, which led to problems when running the app on other PCs. This turned out to be unnecessary!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by