Passing variable from one sub functions to another (GUI)

조회 수: 9 (최근 30일)
Iryna Kovalenko
Iryna Kovalenko 2018년 6월 8일
댓글: Iryna Kovalenko 2018년 6월 8일
Hi, I need to use 2 numbers inputted in a textbox to make a plot in GUI. But it seems that variables are not visible for other function. How can I refer to varX1 and varY1.
function x1_Callback(hObject, eventdata, handles)
varX1=get(handles.x1,'string');
varX1=str2double(varX1);
function y1_Callback(hObject, eventdata, handles)
varY1=get(handles.y1,'string');
varY1=str2double(varY1);
function startDisplay_Callback(hObject, eventdata, handles)
plot(varX1,varY1);
  댓글 수: 5
Iryna Kovalenko
Iryna Kovalenko 2018년 6월 8일
@Stephen Cobeldick Thank you, I saw it. I don't know if you still can see question after the answer is excepted, but I posted one more question there.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Scope Variables and Generate Names에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by