# (FOR STEP RESPONSE GRAPHICS) how to make an inset of matlab figure inside the figure

조회 수: 3 (최근 30일)
N/A 2020년 12월 30일
편집: Mischa Kim 2020년 12월 30일
I have a code like below. How can I get another figure in the figure for the step response when I run this code? Please help me.
s=tf('s');
kp11=0.1517;
ki11=0.0325;
kp1=0.3786;
kd1=0.2694;
C1=kp11+ki11/s;
C2=kp1+kd1*s;
G=(4/(4*s-1))*exp(-2*s);
H1=feedback(G,C2);
H2=feedback(H1*C1,1);
step(H2,'r')
hold on
grid on
xlim([0 100])
ylim([0 1.2])
S=stepinfo(H2)
hold on;
s=tf('s');
kp22=0.1608;
ki22=0.0412;
kp2=0.3904;
kd2=0.3593;
C3=kp22+ki22/s;
C4=kp2+kd2*s;
G=(4/(4*s-1))*exp(-2*s);
H3=feedback(G,C4);
H4=feedback(H3*C3,1);
step(H4,'b')
hold on
grid on
S=stepinfo(H4)
hold on;
s=tf('s');
kp33=0.1387;
ki33=0.0443;
kp3=0.4181;
kd3=0.3873;
C5=kp33+ki33/s;
C6=kp3+kd3*s;
G=(4/(4*s-1))*exp(-2*s);
H5=feedback(G,C6);
H6=feedback(H5*C5,1);
step(H6,'g')
hold on
grid on
S=stepinfo(H6)
hold on;
s=tf('s');
kp44=0.1071;
ki44=0.0394;
kp4=0.4403;
kd4=0.3416;
C7=kp44+ki44/s;
C8=kp4+kd4*s;
G=(4/(4*s-1))*exp(-2*s);
H7=feedback(G,C8);
H8=feedback(H7*C7,1);
step(H8,'m')
hold on
grid on
S=stepinfo(H8)
hold on;
s=tf('s');
kp55=0.0434;
ki55=0.0272;
kp5=0.4695;
kd5=0.2041;
C9=kp55+ki55/s;
C10=kp5+kd5*s;
G=(4/(4*s-1))*exp(-2*s);
H9=feedback(G,C10);
H10=feedback(H9*C9,1);
step(H10,'c')
hold on
grid on
S=stepinfo(H10)

댓글을 달려면 로그인하십시오.

### 답변 (1개)

Mischa Kim 2020년 12월 30일
편집: Mischa Kim 2020년 12월 30일
Hi Dorukhan,
p = get(gca, 'Position');
h = axes('Parent', gcf, 'Position', [p(1)+0.1 p(2)+0.1 p(3)-0.5 p(4)-0.5]);
x = 0:0.1:2;
y = cos(x);
plot(h, x, y, 'r');
and adjust the plot as necessary.

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

### Community Treasure Hunt

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

Start Hunting!

Translated by