how to make a vertical plot?
17 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
hellodarling
am 13 Okt. 2022
Beantwortet: David Hill
am 13 Okt. 2022
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 Kommentare
Akzeptierte Antwort
David Hill
am 13 Okt. 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 Kommentare
Weitere Antworten (1)
Robert U
am 13 Okt. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Subplots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!