Docsity

MATH 241: MATLAB Project #0 - Explanation of Various MATLAB Commands and Operations - Prof, Assignments of Advanced Calculus

Toggle sidebar
bg1
Dr. Wolfe MATH 241 MATLAB PROJECT #0 Due February 12, 2008
This project is to be done with MATLAB, and you should hand in your printed output.
Use the diary command to save your work. Edit the saved file to include your name, the
problem numbers, and the answers to any questions asked in the problems. Then print
your file. For further information on MATLAB, consult the introduction posted on the
class website. Whenever you use a new MATLAB command learn about it by using the
help command; e.g., type help cross to learn about the cross command.
Go to http://www.math.umd.edu/˜jec/matcomp/matcompmfiles/mfiles.html
and download the entire set of m-files into the directory which which you use as the home
directory for your MATLAB work
1. Enter P0 = [2 4 7] and P1 = [1 −1 7] at the >> prompt. Then enter (one at a time)
P0 +P1,P0 −P1,(3 ∗P1 −P0)/4, a = dot(P0,P1),B= cross(P0,P1),norm(P0)
In each case explain the output.
2. With P0 and P1 as in Problem 1, find:
(a) The length of the projection of P1 on P0. (Use the command abs).
(b) An equation of the plane passing through P0,P1 and P2 where P2 = (1,2,3).
3. Here we will use the command plane which you downloaded. Do:
>> P = [2 3 −1];
>> N = [−4 1 2];
>> plane(P, N )
Explain and print out the picture you obtain.
4. Run the following script and print out and explain the picture you obtain.
P0 = [0 0 0];
N1 = [−2.5 2 1];
N2 = [2 1 1];
plane(P0, N 1)
hold on
plane(P0, N 2)
L= cross(N1, N 2);
arrow3(P0, L)
view(68,30)
hold off
Note: Your graphs will not be saved by the use of the diary command. The command
print will cause the current graphics window to be printed at your default printer. Also,
learn how to use the title command to title your graphs.

Partial preview of the text

Download MATH 241: MATLAB Project #0 - Explanation of Various MATLAB Commands and Operations - Prof and more Assignments Advanced Calculus in PDF only on Docsity!

Dr. Wolfe MATH 241 MATLAB PROJECT #0 Due February 12, 2008

This project is to be done with MATLAB, and you should hand in your printed output. Use the diary command to save your work. Edit the saved file to include your name, the problem numbers, and the answers to any questions asked in the problems. Then print your file. For further information on MATLAB, consult the introduction posted on the class website. Whenever you use a new MATLAB command learn about it by using the help command; e.g., type help cross to learn about the cross command. Go to http://www.math.umd.edu/˜jec/matcomp/matcompmfiles/mfiles.html and download the entire set of m-files into the directory which which you use as the home directory for your MATLAB work

  1. Enter P0 = [2 4 7] and P1 = [1 −1 7] at the >> prompt. Then enter (one at a time) P0 + P1, P0 − P1, (3 ∗ P1 − P0)/ 4 , a = dot(P0, P1), B = cross(P0, P1), norm(P0) In each case explain the output.
  2. With P0 and P1 as in Problem 1, find: (a) The length of the projection of P1 on P0. (Use the command abs). (b) An equation of the plane passing through P0, P1 and P2 where P2 = (1, 2 , 3).
  3. Here we will use the command plane which you downloaded. Do:

    P = [2 3 − 1]; N = [− 4 1 2]; plane(P, N ) Explain and print out the picture you obtain.

  4. Run the following script and print out and explain the picture you obtain. P 0 = [0 0 0]; N 1 = [− 2. 5 2 1]; N 2 = [2 1 1]; plane(P 0 , N 1) hold on plane(P 0 , N 2) L = cross(N 1 , N 2); arrow3(P 0 , L) view(68, 30) hold off Note: Your graphs will not be saved by the use of the diary command. The command print will cause the current graphics window to be printed at your default printer. Also, learn how to use the title command to title your graphs.