class_notes16

Class_notes16 - Engineering 3 Class 16 Today midterm solutions more arrays MATLAB functions Office Hours Brendon 11am-12pm Rm 1117 E1 Antoniotoday

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

View Full Document Right Arrow Icon
Engineering 3 – Class 16 Today: • midterm solutions? • more arrays • MATLAB functions Office Hours: Brendon 11am-12pm, Rm. 1117 E1 Antonio…today?
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/06/2010 for the course ENGR 3 taught by Professor Ben-yaakov during the Summer '08 term at UCSB.

Page1 / 9

Class_notes16 - Engineering 3 Class 16 Today midterm solutions more arrays MATLAB functions Office Hours Brendon 11am-12pm Rm 1117 E1 Antoniotoday

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online