GUI didn't update plot

21 ビュー (過去 30 日間)
ChyaYan Liaw
ChyaYan Liaw 2017 年 3 月 15 日
コメント済み: ChyaYan Liaw 2017 年 3 月 18 日
I wanted to create a gui(gui.m and parsedata.m) to import a csv file (test3.csv) and create plots for different parameters. Each column in the csv file shows the data of each parameter. I wanted the plot can be updated when I choose different parameters in the drop-down menu. The file runs with no error, however, it didn't plot any figure when I change the parameters. Any help would be highly appreciated!

回答 (2 件)

ES
ES 2017 年 3 月 16 日
You have changed the plot in the callback of the drop down menu? There is a good example taht comes with MATLAB GUI.
Type guide and select example GUI with Axes and Menu.

Jan
Jan 2017 年 3 月 16 日
There are two function called "parsedata":
  1. as local subfunction in teh callback setPopupMenuString(),
  2. as separate file "parsedata.m".
The latter imports the file with the name 'filename' and the input variable filename is not used. If this function is used for importing, the diagrams are updated, but always with the same values. I assume you have to change these lines:
ftoread = 'filename';
fid = fopen(ftoread);
to
fid = fopen(filename);
  1 件のコメント
ChyaYan Liaw
ChyaYan Liaw 2017 年 3 月 18 日
I changed these lines, but it still didn't work. Here's the updated code. Thanks!

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

カテゴリ

Help Center および File ExchangeDebugging and Analysis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by