2021-04-09 10:21发布
t=(0:
pi
/100:
)';
%长度为101的时间采样列向量
y1=
sin
(t)*[1,-1];
%包络线函数值,是(101x2)的矩阵
y2=
(t).*
(9*t);
%长度为101的调制波列向量
t3=
*(0:9)/9;
%过零点
y3=
(t3).*
(9*t3);
plot
(t,y1,
'r:'
,t,y2,
'b'
,t3,y3,
'bo'
)
% plot(t,y1,'r:')% hold on% plot(t,y2,'b')% plot(t3,y3,'bo')
%hold off
axis
([0,
,-1,1])
%控制轴的范围
x = 0:0.01:20;
y1 = 200*
exp
(-0.05*x).*
(x);
y2 = 0.8*
(-0.5*x).*
(10*x);
figure
,
plotyy
(x,y1,x,y2)
close
all
t=(
*(0:1000)/1000)';
(t);y2=
(10*t);y12=
(10*t);
subplot
(2,2,1),
(t,y1);
(2,2,2),
(t,y2);
(
'position'
,[0.2,0.05,0.6,0.45])
% 假设整个图形窗口长宽都是1
% [0.2,0.05,0.6,0.45]
%0.2表示图像离最左端的距离为0.2
% 0.05表示图像离底端的距离为0.05
% 0.6表示图像的宽为0.6
% 0.45表示图像的高为0.45
(t,y12,
'b-'
,t,[y1,-y1])
t=0:
/100:2*
;
x1=1.15*
cos
(t);
y1=3.25*
x2=0.55*
y2=1.25*
x3=3*
y3=3*
(x1,y1),
([-4 4 -4 4]);
(2,2,3),
(x2,y2),
,[0.6,0.1,0.3,0.8]),
(x3,y3),
最多设置5个标签!
1.用图形表示连续调制波形及其包络线
t=(0:
pi
/100:
pi
)';
%长度为101的时间采样列向量
y1=
sin
(t)*[1,-1];
%包络线函数值,是(101x2)的矩阵
y2=
sin
(t).*
sin
(9*t);
%长度为101的调制波列向量
t3=
pi
*(0:9)/9;
%过零点
y3=
sin
(t3).*
sin
(9*t3);
plot
(t,y1,
'r:'
,t,y2,
'b'
,t3,y3,
'bo'
)
% plot(t,y1,'r:')
% hold on
% plot(t,y2,'b')
% plot(t3,y3,'bo')
%hold off
axis
([0,
pi
,-1,1])
%控制轴的范围
2.双纵坐标
x = 0:0.01:20;
y1 = 200*
exp
(-0.05*x).*
sin
(x);
y2 = 0.8*
exp
(-0.5*x).*
sin
(10*x);
figure
,
plotyy
(x,y1,x,y2)
多子图
close
all
t=(
pi
*(0:1000)/1000)';
y1=
sin
(t);y2=
sin
(10*t);y12=
sin
(t).*
sin
(10*t);
subplot
(2,2,1),
plot
(t,y1);
axis
([0,
pi
,-1,1])
subplot
(2,2,2),
plot
(t,y2);
axis
([0,
pi
,-1,1])
subplot
(
'position'
,[0.2,0.05,0.6,0.45])
% 假设整个图形窗口长宽都是1
% [0.2,0.05,0.6,0.45]
%0.2表示图像离最左端的距离为0.2
% 0.05表示图像离底端的距离为0.05
% 0.6表示图像的宽为0.6
% 0.45表示图像的高为0.45
plot
(t,y12,
'b-'
,t,[y1,-y1])
t=0:
pi
/100:2*
pi
;
x1=1.15*
cos
(t);
y1=3.25*
sin
(t);
x2=0.55*
cos
(t);
y2=1.25*
sin
(t);
x3=3*
cos
(t);
y3=3*
sin
(t);
subplot
(2,2,1),
plot
(x1,y1),
axis
([-4 4 -4 4]);
subplot
(2,2,3),
plot
(x2,y2),
axis
([-4 4 -4 4]);
subplot
(
'position'
,[0.6,0.1,0.3,0.8]),
plot
(x3,y3),
axis
([-4 4 -4 4]);
辅助画图
1,线形,颜色,点形
一周热门 更多>