Error while evaluating UIControl Callback.

Hi i have an error when im lunching my gui. the problem happens within the uibutton group. the buttons functions are different equation that will be processed upon clicking them
function Execute_Callback(hObject, eventdata, handles)
% hObject handle to Execute (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global s n v kp kv ka e1 e2 e A B C ;
n=str2num(get(handles.Ntxt,'String'));
s=str2num(get(handles.Stxt,'String'));
v=str2num(get(handles.Vtxt,'String'));
A=str2num(get(handles.Atxt,'String'));
B=str2num(get(handles.Btxt,'String'));
C=str2num(get(handles.Ctxt,'String'));
gs=v*(s+A)/((s^n)*(s+B)*(s+C));
kp=gs;
e=1/(1+kp);
kv=s*gs;
e1=1/kv;
ka=(s^2)*(gs);
e2=1/ka;
set(handles.Kptxt,'String',kp);
set(handles.Kvtxt,'String',kv);
set(handles.Katxt,'String',ka);
set(handles.Etxt,'String',e);
set(handles.E1txt,'String',e1)
set(handles.E2txt,'String',e2);
switch (get(evendata.NewValue,'Tag'))
case 'radiobutton1'
num=str2num(get(handles.Numeratortxt,'String'));
den=str2num(get(handles.Denominatortxt,'String'));
sys=tf([num],poly([den]));
D=feedback(sys,1,-1);
rs = tf([1],[1 0]);
cs=rs*D;
impulse(rs,cs)
case 'radiobutton2'
num=str2num(get(handles.Numeratortxt,'String'));
den=str2num(get(handles.Denominatortxt,'String'));
sys=tf([num],poly([den]));
D=feedback(sys,1,-1);
rs = tf([1],[1 0 0]);
cs=rs*D;
impulse(rs,cs)
case 'radiobutton3'
num=str2num(get(handles.Numeratortxt,'String'));
den=str2num(get(handles.Denominatortxt,'String'));
sys=tf([num],poly([den]));
D=feedback(sys,1,-1);
rs = tf([1],[1 0 0 0]);
cs=rs*D;
impulse(rs,cs)
end

1 件のコメント

DGM
DGM 2021 年 5 月 10 日
I don't see anything obvious. Without knowing what the rest of the error message says, I don't know. I can't test it either.
I also don't see why all these variables need to be global if they're also being stored in the handles struct.

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInteractive Control and Callbacks についてさらに検索

質問済み:

2021 年 5 月 10 日

コメント済み:

DGM
2021 年 5 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by