This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: B B-A A - c % Determining size of A size(A) % assigning size to a single variable s s = size(A) % accessing elements in size vector s(1) s(2) % assigning size values to separate variables [row col] = size(k) % using variables containing size values % is very useful for k = 1:row disp(k) end for k = 1:s(1) disp(k) end % determining LARGEST dimension of array length(d) length(n) % Using magic function magic(3) D = magic(3) % what is sum along columns sum(D) % what is sum along rows, transpose first F = D' sum(F) % Accessing elements with (row,column) d(1,3) % Accessing elements in array using single number % LINEAR INDEXING d(3) % Accessing elements with (row,column) D(3,2) % Accessing elements in array using single number % LINEAR INDEXING D(6) % Accessing parts of arrays t = D(3,1:3) g = D(3,1:end) h = D(3,:) r = D(3, 2:3) w = D(3, 2:end) q = D(end, 2:end) % Element by Element operations A.^2 A.*2 % Matrix Multiplication D*D size(D)...
View Full Document
This note was uploaded on 03/30/2011 for the course ENGINEERIN 127 taught by Professor Finch during the Spring '08 term at Rutgers.
- Spring '08