フィルターのクリア

How do I get the handle of my current .fig?

3 ビュー (過去 30 日間)
Pedro Guevara
Pedro Guevara 2020 年 5 月 20 日
コメント済み: Geoff Hayes 2020 年 5 月 22 日
Goodnight.
I have the following question. I have 2 .fig files with their respective .m files. In one of the .fig (whose name is -untitled-) create a button to allow me to open the other .fig called -untitled2-. -Untitled2- has a -slider- object that when I move it I want it to redirect the value that it takes to my .fig -untitled-, but the "handles" keeps the button values ​​that allowed me to open the .fig -Untitled2-. I leave codes for further understanding:
Button:
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
openfig('untitled2.fig');
Slide:
function slider1_Callback(hObject, ~, handles)
guidata(hObject,handles);
valor = get(hObject,'value');
set(handles.text2,'String',valor)
handles.data_untitled = valor;
guidata(hObject, handles);
untitled_h = untitled();
The code works for me to send the -slider- data if and only if I do not use the button, that is, directly executing .fig where the -slider- is, but what I want is to be able to open the figure with the button, and then manipulate the -slider- so that it allows me to send the information back to a variable that I have in untitled.m ", which I am not achieving because I suspect that my "handles" is not taking the objects in the figure " untitled2 ".
I leave images for a little more clarity.
I would appreciate your help with this problem. Thank you.
  5 件のコメント
Pedro Guevara
Pedro Guevara 2020 年 5 月 22 日
Thank you Geoff Hayes.
Works !! I hope
I have no more problems. Could I bother you later with any other questions? I thank you for the explanation.
Geoff Hayes
Geoff Hayes 2020 年 5 月 22 日
Glad it worked out!

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by