Problem with get matrix from one function buton to second.

조회 수: 1 (최근 30일)
Brajan Nosal
Brajan Nosal 2019년 9월 10일
답변: Bhargavi Maganuru 2019년 9월 13일
Hello, i have a problem with get a matrix data which i created in one pushbutton. I need it in other pushbutton, but i dont know how corectly set "set" and "get" for cell...;/
i have cell in function pushbutton15_Callback name: tablicaRandLearnFull, value:70x5 double, and i need it in function pushbutton6_Callback,
if (handles.checkbox3.Value == 1.0)
P=[tablicaRandLearnFull(:,3)]
end
i get this error: "Undefined function or variable 'tablicaRandLearnFull'.",
when i put tablicaRandLearnFull(:,3) in command window i get data normally... Could u help me?

채택된 답변

Bhargavi Maganuru
Bhargavi Maganuru 2019년 9월 13일
You can access variables in another callbacks by saving the variables to handles structure, which is usually input to all callbacks.
To save tablicaRandLearnFull variable to handles, use
handles.tablicaRandLearnFull = tablicaRandLearnFull;
guidata(hObject, handles); %to update handles
Access handles in another callback using the following command
handles.tablicaRandLearnFull
Hope this helps!

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by