Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
When I use impulse for two different ss the plot is just one..I need two plots when I get the response and then I want to super impose those two plots..How do I do it
조회 수: 1 (최근 30일)
이전 댓글 표시
A=[0 1 0 0;0 0 -1 0;0 0 0 1;0 0 9 0]; B=[0;0.1;0;-0.1]; C=[0 0 1 0]; x0=[0.1;0;0.1;0]; C'*C %selectingQ based on the above matrix u=1; v=1; Q=[v 0 0 0;0 0 0 0;0 0 u 0;0 0 0 0]; R=0.1; [K,S,e]=lqr(A,B,Q,R) Ac=[(A-B*K)]; Bc=[B]; Cc=[C]; Dc=[0]; impulse(Ac,Bc,Cc,Dc,1,'r'); % from the graph the settling time is about 5sec R1=0.01; [K1,S1,e1]=lqr(Ac,Bc,Q,R1) Ac1=[(Ac-Bc*K1)]; Bc1=[Bc]; Cc1=[Cc]; Dc1=[0]; impulse(Ac1,Bc1,Cc1,Dc1,1,'g');
댓글 수: 0
답변 (1개)
Prajit T R
2018년 3월 20일
Hi Mirza
Just use the 'hold on' command on the line above this one: impulse(Ac1,Bc1,Cc1,Dc1,1,'g'); 'hold on' will ensure that the first plot will not be overwritten, so you can see both the plots together in one figure.
Cheers
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!