Hi,
I am trying to create a GUI where the user can select a value using a slider and then can obtain a plot by pressing a pushbutton. This is the code for the slider:
% --- Executes on slider movement.
function TP_Callback(hObject, eventdata, handles)% hObject handle to TP (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider % get(hObject,'Min') and get(hObject,'Max') to determine range of slider
handles.TP=get(hObject,'Value'); Tp=round(handles.TP); set(handles.text11,'String',Tp);
Then I have a pushbutton callback with the code. Here I need to use the value selected with the slider but it seems that it is not stored as I get the following warning:
"Undefined function or variable 'Tp'."
Could I get some help here?
thank you in advance.
Ana
Best Answer