I am Trying to Plot 3 plots onto the same graph
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to combine 3 figures into the same plot. My code is as follows:
figure(1);
Vm=5.07; % Calculated on Paper
t = linspace(1,48); % Time over 48 hours
V = Vm*sin((2*pi*t)/(Ttide)); % Velocity Equation
plot(t,V)
figure(2);
E=53; %degrees
t = linspace(1,48); % Time over 48 hours
hb=Ab1*cos(((2*pi*t)/Ttide)-E); %Ocean Tide
plot(t,hb)
figure(3);
t = linspace(1,48);% Time over 48 hours
hb1=a0*cos((2*pi*t)/Ttide)%N0
plot(t,hb1)
I have tried using the "hold on" and 'hold off' functions however was not able to get it to work.
0 Kommentare
Antworten (1)
Dave B
am 25 Okt. 2021
You can do this with hold on, just drop the calls to figure.
figure(1);
Vm=5.07; % Calculated on Paper
Ttide = 1; % you didn't give us this...
t = linspace(1,48); % Time over 48 hours
V = Vm*sin((2*pi*t)/(Ttide)); % Velocity Equation
plot(t,V)
hold on
E=53; %degrees
t = linspace(1,48); % Time over 48 hours
Ab1 = 1.2; % you didn't give us this
hb=Ab1*cos(((2*pi*t)/Ttide)-E); %Ocean Tide
plot(t,hb)
a0 = 3; % you didn't give us this
t = linspace(1,48);% Time over 48 hours
hb1=a0*cos((2*pi*t)/Ttide)%N0
plot(t,hb1)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Oceanography and Hydrology finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!