フィルターのクリア

Calling a callback function from another callback in the same Matlab GUI

32 ビュー (過去 30 日間)
Luffy
Luffy 2015 年 10 月 7 日
回答済み: Ka Mirul 2018 年 1 月 28 日
Hi,
I have a callback function of a menu object from which i want to call the callback the function of an edit box.I am calling it the same way as we normally call functions but it doesn't seem to work:
function edit19_Callback(hObject, eventdata, handles)
% hObject handle to edit19 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
string_edit19 = get(hObject,'String');
freq = str2num(string_edit19);
assignin('base','frequency',freq);
% ********************* other part of code **********************
function load_default_Callback(hObject, eventdata, handles)
% hObject handle to load_default (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
edit19_Callback(hObject, eventdata,handles); % -- doesn't work
I have gone through the following link but it doesn't help me: http://in.mathworks.com/matlabcentral/newsreader/view_thread/320742

採用された回答

Walter Roberson
Walter Roberson 2015 年 10 月 7 日
edit19_Callback(handles.edit19, eventdata,handles);
  1 件のコメント
Luffy
Luffy 2015 年 10 月 8 日
I was doing this:
h = findobj('Tag','edit19');
edit19_Callback(h.hObject,eventdata,handles);

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

その他の回答 (1 件)

Ka Mirul
Ka Mirul 2018 年 1 月 28 日
I found the solution here : https://youtu.be/gi1v-aDEou8

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by