class_notes16

# class_notes16 - Engineering 3 Class 16 Today midterm...

This preview shows pages 1–5. Sign up to view the full content.

Engineering 3 – Class 16 Today: • midterm solutions? • more arrays • MATLAB functions Office Hours: Brendon 11am-12pm, Rm. 1117 E1 Antonio…today?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
So far: • arrays: scalars arranged in some logical structure • vectors: 1xn or nx1 arrays (eg. ‘row’ or ‘column’) Matricies are mxn arrays in MATLAB. A = [2, 4, 10; 16, 3, 7]; creates the matrix: Arrays = 7 3 16 10 4 2 A
Array indicies are the row and column numbers of an element. row number always listed first A(4,2) = A(2,3) = Array Addressing [] 9 6 7 3 = V Colon operator used to select ‘subarrays’ V(:) = A(:,3) = A(2:3, 2:3)= = 9 7 3 8 4 10 4 6 2 A not defined 8

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
clear(): use to remove all variables from workspace. Place at the beginning of m-files to avoid errors Useful Functions Function Description length(A) returns # of elements if A is a vector, or largest dimension linspace(a,b,n) creates a row vector of n regularly spaced values between a and b max(A) Returns the largest element if A is a vector.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 9

class_notes16 - Engineering 3 Class 16 Today midterm...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online