ENGRMAE 10 Lecture Notes - Lecture 4: Linear Algebra, Scalar Multiplication, Matlab

38 views2 pages

Document Summary

% c. some useful built-in functions: mean, standard deviation. % d. some review anddition to array addressing from lecture 03. % g. relational and logical operators clear; clc; A=[5 10 15 20 25 10 15 20 15] max(a) [val, loc] = max(a) % stores the max value of a and it"s index location length(a) mean(a) sort(a) median(a) mode(a) A(10:14) = [20 5 5 5 0] % add 5 elements to a. A = [a 20 5 5 5 0] % another (easier?) way to add elements to a mode(a) A =[10:-1:4; ones(1,7); 2:2:14; zeros(1,7)] % colon operator can go negative. B = a([1,3],[1,3,5:7]) % pick out rows 1 and 3 and columns 1,3,5,6,7. % error: g2 = [e ; k] need equal numbers of columns. G(:,3) = [] vec = [5:3:28] vec(6) = [] %% meshgrid: for problems with 2 variables for doing 3d things. % creates x and y matrices that contain the coordinates of a 2d regular.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents