Question: Make my code output the same thing as the first image Basic Matlab Plotting: Use Matlab to create the following single plot with three subplots.

Make my code output the same thing as the first image
Basic Matlab Plotting:
Use Matlab to create the following single plot with three subplots. All titles, gridlines, and axis labels should be as shown.
Notes:
- Each subplot must have the shown title and any axis labels shown - spelling will matter.
- Hint: The Matlab help on subplot shows how to get one plot to extend across two columns.
- The first subplot is an arc, centered at \((3.5,-2)\), with radius \(=1.5\), extending from 450 to 2250 from the positive \( x \)-axis. Use a similar method as previously used to generate 100 pairs of \((x, y)\) data for a whole circle that is easy to modify to go between two angles. Also plotted is a + sign at the center of the arc (created using plot(), not text()). Note that the axes have equal scaling (so the arc
Notes:
Each subplot must have the shown title and any axis labels shown-spelling will matter.
Hint: The Matlab help on subplot shows how to get one plot to extend across two columns.
The first subplot is an arc, centered at (3.5,-2), with radius =1.5, extending from 450 to 2250 from
the positive x-axis. Use a similar method as previously used to generate 100 pairs of (x,y) data for
a whole circle that is easy to modify to go between two angles. Also plotted is a + sign at the
center of the arc (created using plot(), not text()). Note that the axes have equal scaling (so the arc
is circular and not squished) and they extend at least 0.5 past where the circle containing the arc
would be (xlim| and ylim).
The second plot is response =1-exp(- time), plotted from 0 to 10 with blue dash-dot lines. Note
the title and axis labels. Set the y-axis limits such that the lower limit is clearly below the lowest
part of the curve.
The third is two curves: pos=-2cos 3t and vel =6sin 3t. The subplot uses the whole plot width.
There must be axis labels, a legend positioned as shown, and the LineWidth of both curves is 2 for
better visibility.
Some of the functions you will use are also in the PDF handout available on CatCourses.
% Plotting a figure with subplots
% create and clear a figure
clear all;
clf;
figure(1);
% create the three subplots
% Step 1: Set Up the Circular Arc Plot
theta = linspace(deg2rad(45), deg2rad(225),100); % Angle range for the arc
x =3.5+1.5* cos(theta); % x-coordinates of the arc
y =-2+1.5* sin(theta); % y-coordinates of the arc
subplot(2,2,1); % Position in a 2x2 grid
plot(x, y,'b'); % Plot the arc in blue
hold on;
plot(3.5,-2,'r+'); % Center point of the arc in red
title('Circular Arc'); % Title
axis equal; % Ensure equal scaling for a true circular appearance
xlim([15]); % x-axis limits
ylim([-40]); % y-axis limits
grid on; % Turn on grid
hold on
% Step 2: Set Up the Asymptote Plot
t = linspace (0,8,10); % Time vector
response =1- exp(-0.5* t); % Step response approaching an asymptote
subplot(2,2,2); % Position in the 2x2 grid
plot(t, response, 'b:'); % Plot the response as a blue dotted line
title('Asymptote Approaches One'); % Title
xlabel('t (sec)'); % x-axis label
ylabel('Step response (m)'); % y-axis label
grid on; % Turn on grid
ylim([01.1]); % Set y-axis limits to focus on the asymptote
% Step 3: Set Up the Oscillation Plot
t = linspace(0,10,100); % Time vector (extended for clarity)
position =5* sin(2* pi *0.5* t); % Oscillating position with a frequency of 0.5 Hz
velocity =5*2* pi *0.5* cos(2* pi *0.5* t); % Corresponding velocity (derivative of position)
subplot(2,1,2); % Full width subplot in a 2x1 grid
plot(t, position, 'm--', t, velocity, 'b-.');
title('Oscillation Nation');
xlabel('Time (sec)');
ylabel('Response (m or m/s)');
legend('position(m)','velocity(m/s)','location','northwest')
grid on;
Make my code output the same thing as the first

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!