subject
Engineering, 18.02.2020 20:57 kirstenb278

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) / t

t = linspace(-20,20,200); y1 = sin(t) ./ t; figure(1)
clf

plot(t, y1,’-k’) xlabel(’Time (sec)’) ylabel(’Amplitude’)

% generate a time vector

f(t) = 10 cos(ωot + 60◦),

% Now plot an exponentially weighted sinusoid y2 = exp(-abs(t/4)) .* cos(t);
hold on
plot(t, y2,’--r’)

title(’EE 350 Problem Set 1 Problem 5 Example’) xlabel(’Time (sec)’)
ylabel(’Amplitude’)
legend(’sinc(t) = sin(t)/t’, ’e^{-|t|/3} cos(t)’)

(2 points) Three of the lines in the m-file end with a semicolon. What is the function of the semicolon in MATLAB?

(2 points) 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.}

(2 points) Why must we use the operator .* in calculating the signals y1 and y2?

(2 points) What happens if the command hold on is removed from the m-file?

(2 points) What do the commands figure(1) and clf accomplish?

(10 points) 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 sinusoids

y = 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 credit

Turn 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.

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Adouble-strand no. 60 roller chain is used to transmit power between a 13-tooth driving sprocket rotating at 300 rev/min and a 52-tooth driven sprocket. a) what is the allowable horsepower of this drive? b) estimate the center-to-center distance if the chain length is 82 pitches. c) estimate the torque and bending force on the driving shaft by the chain if the actual horsepower transmitted is 30 percent less than the corrected (allowable) power.
Answers: 3
question
Engineering, 04.07.2019 18:10
The thermal expansion or contraction of a given metal is a function of the f a)-density b)-initial temperature c)- temperature difference d)- linear coefficient of thermal expansion e)- final temperature f)- original length
Answers: 2
question
Engineering, 04.07.2019 18:10
Water in a partially filled large tank is to be supplied to the roof top, which is 8 m above the water level in the tank, through a 2.2-cm-internal-diameter pipe by maintaining a constant air pressure of 300 kpa (gage) in the tank. if the head loss in the piping is 2 m of water, determine the discharge rate of the supply of water to the roof top in liters per second.
Answers: 3
question
Engineering, 04.07.2019 18:10
Manometers are good examples of measuring instruments, nowadays they are not as common as before. a)-capacitive probe gauges b)-gravitational gauges deformation ) gauges d)-digital gauges
Answers: 1
You know the right answer?
MATLAB is an important tool that is widely used in industry to analyze dynamic systems. Each problem...
Questions
question
Mathematics, 23.01.2020 00:31
question
History, 23.01.2020 00:31
question
Mathematics, 23.01.2020 00:31
Questions on the website: 13722360