This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: LAB 2 Name: __Ryan Corley ___ Sec_4 _ Examples from Lab 2 Module Example 1 : Choose any 4 x 4 matrix yourself. Call it A. Compute A * A and A .* A. A=[1,2,3,4;4,3,2,1;3,4,2,1;2,1,3,4] A = 1 2 3 4 4 3 2 1 3 4 2 1 2 1 3 4 A*A [ A.*A] ans ans 26 24 25 25 1 4 9 16 24 26 25 25 16 9 4 1 27 27 24 22 9 16 4 1 23 23 26 28 4 1 9 16 Example 2 : Plot sin(4x ) for x in the interval [2 , 2 ] using both the fplot command and the plot command in MATLAB. Experiment with point and line options also. fplot ('sin(4*x)', [2*pi 2*pi]) 642 2 4 610.80.60.40.2 0.2 0.4 0.6 0.8 1 Example 3: Plot both sin(3x) and cos(3x) simultaneously for x in the interval [0, 3 ] using the plot command in MATLAB. fplot('[sin(3*x), cos(3*x)]', [0 3*pi]) 1 2 3 4 5 6 7 8 910.80.60.40.2 0.2 0.4 0.6 0.8 1 Example 4 : Label the plot (i.e. the XAxis, the YAxis, and a title) obtained in the previous example. Use legends in MATLAB to distinguish the functions....
View
Full
Document
 Fall '07
 MonicaHurdal

Click to edit the document details