how to make a vertical plot?
19 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
David Hill
on 13 Oct 2022
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 Comments
More Answers (1)
Robert U
on 13 Oct 2022
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 Comments
See Also
Categories
Find more on Subplots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!