MatLab Basics Flashcards

1
Q

what are the Two Main Windows in Matlab?

A
  1. Command Window
  2. Editor Window
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Uses of Command Window in MatLab

A

Useful for testing, immediate output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Uses of Editor Window in Matlab

A

-Word Processing environment
-Multiple lines of code
-Can be saved and exectued

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what are M files, what do they contain?

A

Matlab Script File
-series of commands
-can be main program or function
-.m file extension

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Function

A

Executable process
-Can’t be executed independently
-must be called by a statement
-data is passed to a function
-output is passed back to calling program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Program

A

Executes a series of commands or functions
-all variables created in a program are considered global variables
-can be executed independantly
-can be executed in another program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Green Text

A

Comments
-preceded by a %
-not included in operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Hierarchy of functions

A

Main Program -> function -> (sub) function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Variable Naming Protocol

A

Rule 1: Must consist of only letters a-z, digits 0-9 and underscore
Rule 2: Must start with a letter
Notes:
-up to 31 characters
-case sensitive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Numeric Variable

A

contains only numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

String Variable

A

contains numbers and letters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Basic Arithmetic Functions in MatLab

A

Addition +
Minus -
Multiply element by element .*
Divide element by element ./
Matrix Multiply *
Matrix Right Divide /

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Element by element math

A

-Most functions will not use matrix math
-item to item comparison
-Arrays must be of equal dimensions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Where are Relational Operators used?

A

Used in loops and if statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Comparative Relational Operators

A

equal
not equal
less than
greater than
less than or equal
greater than or equal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Logical Relational Operators and their calling convention

A

AND &
OR |
NOT ~

17
Q

Matrix Indexing

A

Colon Operator :

18
Q

Calling an entire column

A

(:,x) all rows in x column

19
Q

Calling an entire row

A

(x,:) all columns in x row

20
Q

ones

A

calls an array of 1’s of the specified size
e.g. ones(2,2) = 1 1
1 1

21
Q

Zeroes

A

calls an array of 0’s of the specified size

22
Q

mean

A

calls mean of a variable

23
Q

std

A

calls standard deviation of a variable

24
Q

plot

A

linear plot (X,Y)
plots x vs Y

25
Q

subplot

A

creates axes in tiled positions

26
Q

ezplot

A

not a recommended function
plots function over default domain

27
Q

sin,cos,tan

A

Sine, Cosine and Tangent
Conversely:
asin,acos,atan

28
Q

clear

A

clear variables and functions from memory (workspace)

29
Q

clc

A

clear command window

30
Q

close

A

close figure or specified window

31
Q

close all

A

closes all windows and Matlab

32
Q

==

A

equal

33
Q

~=

A

not equal

34
Q

<

A

less than

35
Q

>

A

greater than

36
Q

<=

A

less than or equal

37
Q

> =

A

greater or equal