For each of the problems in this lab assignment, write a separate MATLAB m-file.
ID: 3815557 • Letter: F
Question
For each of the problems in this lab assignment, write a separate MATLAB m-file. The name of each m-file must be exactly as specified in the corresponding problem statement. Submit your m files by uploading to Blackboard before the due date. A p-file (an encrypted script file) for problems i, 2, and 3 are available on the Lab page of the course website. You can download this file and run it from the command line to see how your code should behave. Your plots should exactly match the plots created by the p-files. 1. Filename: MAE1090 Lab8 1.m Write a script to plot the function y(x) -0.5 sin(2x) for 100 values of x between 0 and 10. Use a2-point-wide solid blue line for this function. Then plot the function y(x) e 0.5x cos(2x) on the same axes. Use a 3-point-wide dashed red line for this function. Be sure to include a legend, title, axis labels, and grid on the plot. 2. Filename: MAE1090 Lab8 2.m The spiral of Archimedes is a curve described in polar coordinates by the equation where r is the distance of a point from the origin, and 0 is the angle of the point in radians with respect to the positive x-axis. Write an m-file to create a plot of the spiral of Archimedes using 1000 points for 0 S 6 S 6t when k -0.5. Be sure to include a title, axis labels, and grid on the plot. Hint: axis equal 3. Filename: MAE1090 Lab8 3.m The output power produced by a rotating motor is given by the equation INDCaUmExplanation / Answer
Include labels and titles on your own:
Create a matlab file and paste this. Run and try to understand the procedure
% First create a linearly spaced vector of 1x100 and take its transpose txo
% convert to 100x1 vector
A=linspace(0,10);
X=transpose(A);
%initialize Y1
Y1=ones(100,1);
for i = 1:100
% find the values for Y1 corresponding to X
Y1(i)=exp(-0.5*X(i))*sin(2*X(i));
end
plot(X,Y1,'b','LineWidth', 2);
% hold onn will plot the next graph on the same plot
hold on
Y2=ones(100,1);
for i = 1:100
Y2(i)=exp(-0.5*X(i))*cos(2*X(i));
end
plot(X,Y2,'r--','LineWidth', 3);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.