how to make a vertical plot?
17 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I would like to vertical plot with this script.
Thanks in advance!
My script is below.
clear all; clc; close all;
r=[0 0 0 0 0 0 0 0 0 0 0.25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0 0 0 0 0 0 0 0 0 0 0 ];
w=[0 0 -0.5 0 1 2 1 0 -0.5 0 0];
s=conv(r,w);
dt=0.001;
Nr=length(r);
Nw=length(w);
N=length(s);
t=(0:N-1)*dt;
subplot(121)
plot(t,s,'k')
hold on
stem(t(1:Nr),r,'r')
xlabel('zaman(s)','FontName','TR Arial')
ylabel('Zaman(s)','FontName','TR Arial')
snoise=s+0.01*randn(size(s));
subplot(122)
plot(t,snoise,'k')
hold on
stem(t(1:Nr),r,'r')
xlabel('zaman(s)','FontName','TR Arial')
ylabel('Zaman(s)','FontName','TR Arial')
0 个评论
采纳的回答
David Hill
2022-10-13
r=[0 0 0 0 0 0 0 0 0 0 0.25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0 0 0 0 0 0 0 0 0 0 0 ];
w=[0 0 -0.5 0 1 2 1 0 -0.5 0 0];
s=conv(r,w);
dt=0.001;
Nr=length(r);
Nw=length(w);
N=length(s);
t=(0:N-1)*dt;
subplot(121)
plot(t,s,'k')
hold on
stem(t(1:Nr),r,'r')
xlabel('zaman(s)','FontName','TR Arial')
ylabel('Zaman(s)','FontName','TR Arial')
snoise=s+0.01*randn(size(s));
subplot(122)
plot(t,snoise,'k')
hold on
stem(t(1:Nr),r,'r')
xlabel('zaman(s)','FontName','TR Arial')
ylabel('Zaman(s)','FontName','TR Arial')
view(90,90)
0 个评论
更多回答(1 个)
Robert U
2022-10-13
Hi Ebru Ozcan,
have a look at the viewing options of the axes.
clear all; clc; close all;
r=[0 0 0 0 0 0 0 0 0 0 0.25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0 0 0 0 0 0 0 0 0 0 0 ];
w=[0 0 -0.5 0 1 2 1 0 -0.5 0 0];
s=conv(r,w);
dt=0.001;
Nr=length(r);
Nw=length(w);
N=length(s);
t=(0:N-1)*dt;
sh{1} = subplot(121);
plot(t,s,'k')
hold on
stem(t(1:Nr),r,'r')
xlabel('zaman(s)','FontName','TR Arial')
ylabel('Zaman(s)','FontName','TR Arial')
snoise=s+0.01*randn(size(s));
sh{2} = subplot(122);
plot(t,snoise,'k')
hold on
stem(t(1:Nr),r,'r')
xlabel('zaman(s)','FontName','TR Arial')
ylabel('Zaman(s)','FontName','TR Arial')
sh{1}.CameraUpVector = [-1,0,0];
Kind regards,
Robert
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!