MATLAB Answers

help with uicontrol pushbutton

1 view (last 30 days)
Adnan Kantemur
Adnan Kantemur on 20 Mar 2018
Answered: Gayatri Menon on 9 Apr 2018
Hi there,
I am trying to create a gui without using guide. I have 2 tables and 2 push buttons on my gui panel. 1 table has fix number of row and column. However, number of column for the other table will change with user input(row is fixed to 6). Based on the data in the tables, I will do some calculation whenever user press the "calculate" push button. Problem starts with calculate push button. I got "Undefined function or variable 't'." error, whenever I want to get the data from tables.( t is name of the one table) . I attached my .m file.

  0 Comments

Sign in to comment.

Answers (1)

Gayatri Menon
Gayatri Menon on 9 Apr 2018
Hi,
The pushbutton_callback don't have access to 't'.You could find the handle of the table using "findobj" and then use this handle as per your usecase.
function pushbutton_Callback(hObject, eventdata)
h=findobj('Tag','t')
StageParameters=str2double(get(h,'Data'))
PinParameters=str2double(get(h,'Data'))
end
Please refer the below link for more information:
Hope the above helps.
Thanks

  0 Comments

Sign in to comment.

Sign in to answer this question.