App.designer to plot step response
이전 댓글 표시
In Appdesigner, I create a app.UIAxes and a app.Button, how to write a callback to use this app.UIAxes to plot a step response using the command 'step(tf)' when I push down this Button.
댓글 수: 1
Diego Roa
2022년 11월 21일
R = app.Resistencia.Value;
C=app.Condensador.Value;
H=tf([0 1],[1 1/(R*C)])
step(app.UIAxes,H)
답변 (1개)
Sindhuja Parimalarangan
2017년 2월 21일
You can extract the output of the step function and use the "plot" function in App Designer. Here is an example callback function for the Button :
% Button pushed function: PlotButton
function PlotButtonPushed(app, event)
tf = 1:3:100;
a = [-0.5572,-0.7814;0.7814,0];
b = [1,-1;0,2];
c = [1.9691,6.4493];
sys = ss(a,b,c,0);
[y,t] = step(sys);
plot(app.UIAxes,y(:,:,1));
end
You could execute the "step" function in MATLAB to figure out how to extract relevant data from the output of the "step" function for plotting.
댓글 수: 4
jiarui zhang
2017년 2월 22일
Franklin Ngo
2018년 6월 28일
@jiarui zhang: Did you find a solution for this? I have a same problem with you, please share if you have solution. Thank you.
Denis RONDEAU
2020년 3월 9일
same problem and no answer :(
Carlos Filho
2020년 4월 17일
카테고리
도움말 센터 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!