MATLAB Answers


How to browse and open txt file with columns separated by comma and then plot specific columns of txt file in app designer?

Petros Freiderikos Martinidis さんによって質問されました 2019 年 5 月 15 日
最新アクティビティ Jan
さんによって 回答されました 2019 年 5 月 15 日
Hi there,
I want to make an app in matlab app designer where i can press a button to browse in my pc for a .txt file to be plotted. The .txt files have columns separated by comma. In the first line are the name of every column and in the next lines are the values. Finally i want to plot the first and the 4th column of the .txt file in the app.
Thank you in advance!
An example of a .txt file:

  1 件のコメント

2019 年 5 月 15 日
These are two separate tasks: making the function that does the work, and making the GUI with a single button. For both you should be able to find a lot of examples. What have you tried so far?

サインイン to comment.

1 件の回答

回答者: Jan
2019 年 5 月 15 日

  • "I want to make an app in matlab app designer"
(By the way: It was extremely hard to find this command. I've searched in the online documentation for 20 minutes without success. But this linke revealed, how to start the AppDesigner: )
  • "browse in my pc for a .txt file"#
Insert uigetfile('*.txt') in the callback.
  • "The .txt files have columns separated by comma."
Use readmatrix.
  • "plot the first and the 4th column of the .txt"
plot(Data(:, 1), Data(:, 2));

  0 件のコメント

サインイン to comment.

Translated by