I am Trying to Plot 3 plots onto the same graph
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Dave B
2021 年 10 月 25 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Oceanography and Hydrology についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!