Hi, use 'to workspace' block to send both signals to the work space. Then in the command window use for example 'plot(t1,x1,t2,x2)' to plot them on the same figure. Women shoe size 5.
How can i get the 2 plots to come out on the same figure?
%% Problem parameters
![Graph Graph](/uploads/1/3/6/9/136972342/574451586.png)
m = 0.05; % Mass of projectile (kg)
- To plot on a specific axes, insert the axes-handle as the first argument of stem. The conversion from m/s to km/h is directly written in the call to stem. Finally, it's needed to set the xlim -property of the both axes to the same values.
- This video explains about how to overlay or multiple lines of different graphs in a single Matlab figure by using 4 different methods. For more details and m.
- I mean: I have ten graphs to plot on the same figure. Each graph has its own (let's call it) related-graph, which has to be plotted on the same image. I want each graph and its related-graph to be the same color!
- I have to compare the results of 2 audio files on the same graph. I can't use hold on and hold off here as the same code is being run separately. So I give input as the first audio file and get a graph, and then I give second audio file as input and get another graph. How am I supposed to see the result on the same axis in 2 colours?
theta = 25; % Initial angle (degrees)
x0 = 0; % Initial distance (m)
vu_NOdrag = 50; % Initial velocty with no drag (m/s)
p = 1.183;% Density of air (kg/m^3)
A = pi*r^2; % Area
x = x0;
x_NOdrag = x0;
ay = 0;
ay_NOdrag = 0;
sig = ((theta)*pi)/180;% converting degrees to radians
t_NOdrag = 0
% Instantanious angle (changes with time)
RADangle_NOdrag = sig;
% Arrays to store x and y values for each step
yCoordinates = [];
yCoordinates_NOdrag = [];
% Weight force (ball)
% Time step, the smaller the time step the more accurate the approximation.
dt = 1;
while y >= 0
fd = -0.5 * Cd * A * (vu^2); % DRAG SOLUTION
% Equations of motion
fx = fd * cos(RADangle);
% Acceleration components
ax = fx/m;
![2 Plots Same Graph Matlab 2 Plots Same Graph Matlab](/uploads/1/3/6/9/136972342/212981492.png)
% Calculating velocity components using acceleration components
vx = (vu*cos(RADangle) + (ax * dt));
% Define magnitude of velocity using velocity components
vu = sqrt((vx^2) + (vy^2));
% Define angle using velocity components
RADangle = atan2(vy,vx);
% Calculating possition using velocity and acceleration componets,
x =x + vx * dt + .5*ax*(dt^2);
yCoordinates = [yCoordinates y];
% Time increasing by incriments of the chosen time step
while y_NOdrag>=0
fd_NOdrag = 0; % NO DRAG SOLUTION
% No drag
fy_NOdrag = fd_NOdrag * sin(RADangle) + fg;
% No drag
ay_NOdrag = fy_NOdrag/m;
% No drag
vx_NOdrag = (vu_NOdrag*cos(RADangle_NOdrag) + (ax_NOdrag * dt_NOdrag));
vy_NOdrag = (vu_NOdrag*sin(RADangle_NOdrag) + (ay_NOdrag * dt_NOdrag));
% No drag
vu_NOdrag = sqrt(((vx_NOdrag)^2) + ((vy_NOdrag)^2));
% No drag
x_NOdrag =x_NOdrag + vx_NOdrag * dt_NOdrag + .5*ax_NOdrag*(dt_NOdrag^2);
y_NOdrag = y_NOdrag + vy_NOdrag * dt_NOdrag + .5*ay_NOdrag*(dt_NOdrag^2);
end
disp(['Time taken to reach ground = ', num2str(t), ' seconds'])
disp(['Total distance travelled = ', num2str(x), 'metres'])
2 Plots Same Graph Matlab
disp(['Time taken to reach ground (with NO drag) = ', num2str(t), ' seconds'])
2 Plots Same Graph Matlab Regression
disp(['Total distance travelled (with NO drag) = ', num2str(x_NOdrag), 'metres'])
Plot Two Graphs Matlab
xlabel('Distance (m)')
title('Ball Flight Path')
2 Plots Same Graph Matlab Calculator
plot(xCoordinates_NOdrag, yCoordinates_NOdrag)