MatLab Basics Flashcards

(37 cards)

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
subplot
creates axes in tiled positions
26
ezplot
not a recommended function plots function over default domain
27
sin,cos,tan
Sine, Cosine and Tangent Conversely: asin,acos,atan
28
clear
clear variables and functions from memory (workspace)
29
clc
clear command window
30
close
close figure or specified window
31
close all
closes all windows and Matlab
32
==
equal
33
~=
not equal
34
<
less than
35
>
greater than
36
<=
less than or equal
37
>=
greater or equal