StepResponse.fig
function OK_Callback(hObject, eventdata, handles)
global x y
syms s;
num = str2sym(get(handles.num1, 'String'));
den= str2sym(get(handles.den1, 'String') );
sys = tf(sym2poly(num), sym2poly(den));
x= eval(get(handles.x_time,'String'));
u = ones(size(x));
[y, ~] = lsim(sys, u, x);
plot ( x,y)
This gui , I run it code it is work but I call second gui I have error. Dot indexing is not supported for variables of this type.
" Error in stepresponse>OK_Callback (line 127) num = str2sym(get(handles.num1, 'String'));
Error in gui_mainfcn (line 95) feval(varargin{:});
Error in stepresponse (line 42) gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)stepresponse('OK_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback. "
Second gui :
function listbox2_Callback(hObject, eventdata, handles)
h= get(hObject,'Value');
switch h
case 1
open Nyquist.fig
case 2
open stepresponse.fig
end
I am not solving problem because works sperately but not work together.