How to create list of checkboxes and plot checked boxes

조회 수: 11 (최근 30일)
Florian Bastiaens
Florian Bastiaens 2015년 5월 12일
댓글: Florian Bastiaens 2015년 5월 27일
Hi, I use a script to import data (multiple measurements) in a struct with several fields. I plot two of these fields(specific: viscosity and temperature) and use an other field for the name in the legend. I am saving new measurements to the already excisting data in the struct. Now I would like to make checkboxes so that only the selected measurements are plotted in a figure.
So a checkbox should include the specific measurement to a new struct which I use to plot the figure.
I cant use a for loop because this is possible in combination with a function. And I cant use the data in my workspace in a function. I tried working with GUIDE and:
checkbox = uicontrol('style','checkbox','units','pixels',...
but it didnt work. Does someone know how to do this?

답변 (1개)

Vinod Sudheesh
Vinod Sudheesh 2015년 5월 27일
Hi Florian,
I have a few suggestions for you regarding this question
1) You could have the "plot" and "delete" operations of the data corresponding to a "checkbox" performed in the "Callback" function of the "Checkbox" object. You could query the the "Value" property of the "checkbox" to see if it is in "checked mode" or "unchecked mode".
2) If the "Variable" of interest say "x" is available in the "base workspace", you could bring it inside a function by using the command below
x=evalin('base','x');
Hope this helps !
Thanks Vinod
  댓글 수: 1
Florian Bastiaens
Florian Bastiaens 2015년 5월 27일
He Vinod,
Thank you for the response. I fixed both problems. The second one using your evalin. Thanks!

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

카테고리

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