- #1
DianeS
- 4
- 0
Hello guys! I have an issue, I'm trying to make a program in which you can get a bode plot by knowing the transfer function in guide. The basic idea is this: you enter 4 numbers in the interface and by those numbers you can know the transfer function, basically I'm doing this as a final step:
a = get(handles.T1_editText,'String');
b = get(handles.T2_editText,'String');
c = get(handles.T3_editText,'String');
d = get(handles.T4_editText,'String');
num=[a*b,a+b,1];
den=[c*d,c+d,1];
sys=tf(num,den);
bode(sys)
guidata(hObject, handles);
I know there is something wrong with it, because I'm not getting the same plots i get in MATLAB to check the results (i write the transfer function in numbers). And another problem i have is that When i enter certain values I don't even get a plot and i get this message:
? Error using ==> mtimes
Inner matrix dimensions must agree.
Error in ==> lol>Grafica_pushbutton_Callback at 213
num=[a*b,b+a,1];
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> lol at 42
gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)lol('Grafica_pushbutton_Callback',hObject,eventdata,guidata(hObject))
? Error while evaluating uicontrol Callback
Which doesn't happen with different values.
Oh and one more thing, when i get do get the plot, it's all over my GUI screen, and i can't even see, is there a way to plot it in a different window by using a command?
I'll put up some images of what I'm talking about so you have a better idea.
I'm kinda new to this MATLAB stuff, so try to bare with me :)
Thanks in advance for your answers.
a = get(handles.T1_editText,'String');
b = get(handles.T2_editText,'String');
c = get(handles.T3_editText,'String');
d = get(handles.T4_editText,'String');
num=[a*b,a+b,1];
den=[c*d,c+d,1];
sys=tf(num,den);
bode(sys)
guidata(hObject, handles);
I know there is something wrong with it, because I'm not getting the same plots i get in MATLAB to check the results (i write the transfer function in numbers). And another problem i have is that When i enter certain values I don't even get a plot and i get this message:
? Error using ==> mtimes
Inner matrix dimensions must agree.
Error in ==> lol>Grafica_pushbutton_Callback at 213
num=[a*b,b+a,1];
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> lol at 42
gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)lol('Grafica_pushbutton_Callback',hObject,eventdata,guidata(hObject))
? Error while evaluating uicontrol Callback
Which doesn't happen with different values.
Oh and one more thing, when i get do get the plot, it's all over my GUI screen, and i can't even see, is there a way to plot it in a different window by using a command?
I'll put up some images of what I'm talking about so you have a better idea.
I'm kinda new to this MATLAB stuff, so try to bare with me :)
Thanks in advance for your answers.