I am Trying to Plot 3 plots onto the same graph
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Dave B
el 25 de Oct. de 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 comentarios
Ver también
Categorías
Más información sobre Oceanography and Hydrology en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!