subject
Engineering, 24.09.2020 21:01 ilmnow

MATLAB is an important tool that is widely used in industry to analyze dynamic systems. Each problem set will contain an exercise that introduces various features of MATLAB. When using MATLAB, you can learn about a specific MATLAB function by typing help followed by the MATLAB function name. Typing help by itself will display a long list of topics for which help is available. Start MATLAB and set the Current Folder to your working directory. Select New Script under the File tab and save the following MATLAB m-file as go. m in your directory. Execute the m-file by typing go at the command prompt, alternatively, press F5 when the cursor is positioned in the MATLAB editor window containing the file go. m.% Example m-file% Plot the sinc(x) function, where sinc(t) = sin(t) / tt = linspace(-20,20,200); y1 = sin(t) ./ t; figure(1)clfplot(t, y1,’-k’) xlabel(’Time (sec)’) ylabel(’Amplitude’)% generate a time vectorf(t) = 10 cos(ωot + 60◦),% Now plot an exponentially weighted sinusoid y2 = exp(-abs(t/4)) .* cos(t);hold onplot(t, y2,’--r’)title(’EE 350 Problem Set 1 Problem 5 Example’) xlabel(’Time (sec)’)ylabel(’Amplitude’)legend(’s inc(t) = sin(t)/t’, ’e^{-|t|/3} cos(t)’)Three of the lines in the m-file end with a semicolon. What is the function of the semicolon in MATLAB? What are the dimensions of the vectors t, y1, and y2 generated by the example m-file? {Hint: Use the MATLAB command whos or size.}Why must we use the operator .* in calculating the signals y1 and y2?What happens if the command hold on is removed from the m-file?What do the commands figure(1) and clf accomplish?Type help subplot at the MATLAB command line to learn about the function subplot. Add code to the example m-file so it that plots the sinusoidsy = 2e−t/2 sin(2π t)x = 2e−t/2 cos(2π t)in the upper subplot of figure 2, and in the lower subplot of figure 2, plots y versus x for 0 ≤ t ≤ 4. Use a time vector that contains 300 uniformly spaced points. For the upper subplot, show y as a solid black curve and xas a dashdot blue curve using a single plot command line. Label the two curves in the upper subplot using the legend command. For the lower subplot, use a solid magenta curve and follow the plot command by the command line axis equal. Why benefit does the command axis equal provide?To receive creditTurn in figures 1 and 2 along with a copy of your m-file. Include your name and section at the top of the m-file as comment lines. Use the MATLAB command gtext to place your name and section number within each figure. Make sure that you appropriately label the x and y axes; no credit is given for MATLAB plots whose axes are unlabeled. Use the legend command to distinguish multiple curves in a single plot. Add an appropriate title to each figure.

ansver
Answers: 1

Another question on Engineering

question
Engineering, 03.07.2019 14:10
Explain the difference laminar and turbulent flow. explain it with the shear stress and the velocity profiles.
Answers: 1
question
Engineering, 04.07.2019 18:10
Thermal stresses are developed in a metal when its a) initial temperature is changed b) final temperature is changed c) density is changed d) thermal deformation is prevented e) expansion is prevented f) contraction is prevented
Answers: 2
question
Engineering, 04.07.2019 18:10
Water at 55c flows across a flat plate whose surface temperature is held constant at 95c. if the temperature gradient at the plate's surface for a given value of x is 18 c/mm, find a) local heat transfer coefficient. b) heat flux
Answers: 3
question
Engineering, 04.07.2019 18:10
Burgers vector is generally parallel to the dislocation line. a)-true b)-false
Answers: 2
You know the right answer?
MATLAB is an important tool that is widely used in industry to analyze dynamic systems. Each problem...
Questions
question
Physics, 14.12.2020 01:30
question
Mathematics, 14.12.2020 01:30
Questions on the website: 13722360