Question: 1 . 1 4 Change the current directory to mynewdir. Then open an Edit / Debug Window and add the following lines: ? ? %

1.14 Change the current directory to mynewdir. Then open an Edit/Debug Window and add the following lines:
??% Create an input array from -2***to2***
t=-2***:10:2***
??& calculate |sin(t)|
x=abs(sin(t));
??& plot result
plot (t,x);
Details
Statements added in the Edit Debug window. Line 1.% Create an input array from negative 2 asterisk pi to 2 asterisk pi. Line 2.t= negative 2 asterisk pi colon pi/10 colon 2 asterisk pi, semi-colon. Line 3. Blank. Line 4.% Calculate, pipe, s i n, left parenthesis, tright parenthesis, pipe. Line 5. x = a b s, left parenthesis, s i n, left parenthesis, t, right parenthesis, right parenthesis, semicolon. Line 6. Blank. Line 7.% Plot result. Line 8. plot, left parenthesis, t, comma, x, right parenthesis, semi-colon.
Save the file with the name test 2.m, and execute it by typing test 2 in the Command Window. What happens?
1 . 1 4 Change the current directory to mynewdir.

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!