필터 지우기
필터 지우기

How to plot only variables selected by a user in GUI?

조회 수: 5 (최근 30일)
Wiktoria Glogowska
Wiktoria Glogowska 2019년 7월 22일
댓글: Stephen23 2019년 7월 22일
I am creating a GUI which after pushbutton1 will load the data which is stored in handles as a structure. There are 10 variables available (stored as a field) and data and time is stored as different fields in this structure. I would like to create a list which will allow user to choose up to 5 variables from the list and then plot then variables (from data) against time. I have created a list with strings, but I am not sure how to connect that string to the variables names and the actual columns in the dataset:
list = {'varname1','varname2',..., 'varname10' };
[indx,tf] = listdlg('ListString',list);
Also how to update that list with those that has been chosen? (I was thinking of a list that is ''dynaically'' changed once the user has selected the variables.)
  댓글 수: 1
Stephen23
Stephen23 2019년 7월 22일
@Wiktoria Glogowska: if you want a more dynamic GUI then perhaps a simpler approach would be to have five drop-down menus (i.e. uicontrol) which the user can select from, and then simply update the plot within the callback of each drop-down menu. That way you could easily use handles and indices very neatly to keep simply update the line data.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by