Matlab quiz one through plots | Quizlet

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 22

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

23 Terms

1

Error icon

Shows where code is invalid

<p>Shows where code is invalid</p>
New cards
2

Array

orderly arrangement of numbers, terms, or symbols. (Columns and rows)

New cards
3

Square Brackets

How you create an array.

ex y = [7 9] creates the array 7 9

also called a row vector

New cards
4

Row vector

Array with one row and multiple columns

New cards
5

[ ; ] (square brackets separating data with semicolons)

creates a column vector

y = [7;9] produces

7

9

New cards
6

Matrix

Made with a combonation of rows and column's

Ex: c = [ 5 6 7; 8 9 10]

creates

5 6 7

8 9 10

New cards
7

:

colon is how you create evenly spaced row vectors

1:9 creates

1 2 3 4 5 6 7 8 9

more practial for larger rows

New cards
8

How to change spacing when using a colon :

add step inbetween

Ex 22:2:26 would produce

22 24 26

New cards
9

If you know the number elements instead of the spacing use what command

linspace(starting number, ending number, number of elements)

New cards
10

How to convert linspace and : into columns instead of rows?

Use ' at the end

Ex linspace(1, 5, 3)'

New cards
11

rand(row, column) command

creates random matrices of random numbers, number in parentheses denotes how large it is

Ex rand(5) creates a 5 by 5 matrix

New cards
12

How to create a matrix of certain numbers

use the number in place of rand

ex. zeros(3, 2)

0 0 0

0 0 0

New cards
13

How to extract a single data point from a matrix

variable = datafilename(row, column)

New cards
14

End

Refers to last row or column

New cards
15

: when extracting data points

When x = data(:, 2)

The colon refers to all the elements in the second column

So it will extract a whole row or a whole column

Or it can set a range

ex y = data(:, end-1:end) extract's the last two columns of data

New cards
16

How to change a single number in a matrix

dataname(element location) = new value

New cards
17

Getting max and mins

max(dataname)

New cards
18

.*

Preforms element wise multiplication

New cards
19

Size function

Tells you rows and columns in a data set

You can also define rows and columns

Ex [r, c] = size(data) will produce r = # of rows and c = # of columns

New cards
20

How to create a random matrix with min and max numbers and a specific amount of rows and columns

Variable name = randi([lowest number, highest number], number of rows, number of columns)

New cards
21

Hold on command

Plots two functions on the same graph

Plot(x, y, "specifications")

Hold on

Plot(x, y, "specifications")

New cards
22

Hold off

Plots no longer on the same graph

New cards
23

Vector plotting with line width

Plot(y, linewidth = #)

New cards
robot