From the course: MATLAB 2018 Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Use vectors and matrices in a function - MATLAB Tutorial
From the course: MATLAB 2018 Essential Training
Use vectors and matrices in a function
- [Instructor] Matrices and vectors can contain many types of values. In this movie, I will assume they contain meaningful numbers such as measurements from your business operation or experiments. Using these values, we can calculate minimums, maximums, running totals, and other characteristics. I have a blank command window in MATLAB, so I need to start by creating some data. I'll start with a vector, and I'll just call it vec1, then an equal sign for assignment, and I'll do a range, so I'll type a left square bracket and then the number three, a colon, the number six, colon, and 33. So what I want are the numbers from three to 33, going up in increments of six, so three, nine, 15, 21, and so on. Type a right square bracket to close the definition, enter, and I get my values. The min function will return the smallest or minimum value from a vector. So if I type min, M-I-N, and then vec1, the name of my variable, right parentheses and enter, that I get the answer of three which is…
Contents
-
-
-
-
Define vectors and matrices5m 56s
-
(Locked)
Refer to matrix and vector elements3m 25s
-
(Locked)
Overview of matrix multiplication2m 56s
-
(Locked)
Perform matrix multiplication2m 14s
-
(Locked)
Perform scalar and element-wise operations on vectors and matrices6m 27s
-
(Locked)
Use vectors and matrices in a function5m 54s
-
(Locked)
Generate special matrices5m 1s
-
(Locked)
Transpose and find the inverse of matrices5m 47s
-
-
-
-
-
-