Coding 1 Final MATLAB Flashcards

1
Q

What should variables start with?

A

A letter of the alphabet, and then they can have letters, digits, and underscores.

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

What does clear do?

A

Removes all variables in the workspace

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

Are variable names case-sensitive

A

Yes

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

What does clc do?

A

clears command window display

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

what does who do

A

displays a list of all variables stored

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

what does whos do?

A

Provides a more detailed list of the variables, including the size and data type of each variable.

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

what does abs() do?

A

finds the absolute value of a number in the parenthesis.

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

what does nthroot(X,N) do?

A

Finds the nth root of x

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

What does MATLAB stand for?

A

Matrix Laboratory

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

What is a colon operator?

A

first:step:last

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

what does 5:3:14 return?

A

[5 8 11 14]

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

what does 1:4 return?

A

[1 2 3 4]

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

what does 4:-1:1 return?

A

[4 3 2 1]

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

what does Linspace(x,y,n) do?

A

Creates a linearly spaced vector with n values in the inclusive range from x to y

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

What does Linspace(4,7,3) return?

A

[4 5.5 7]

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

what is the default number of points for linspace if n is omited

A

100 points

17
Q

What does Logspace(x,y,n) do?

A

Creates a logarithmically spaced vector with n values in the inclusive range from 10^x to 10^y

18
Q

what does logspace(2,4,3) return?

A

[100 1000 10000]

19
Q

what is the default number of points if n is omitted in logspace?

20
Q

What is concatenation?

A

Creating vectors by joining together existing vectors or adding elements to existing vectors

21
Q

what is an algorithm

A

A sequence of steps needed to solve a problem.

22
Q

What is a modular program

A

Multiple functions that implement each step.

23
Q

Where do inputs come from

A

external device, the user

24
Q

Where does the output go?

A

To an external file, and to the screen

25
Q

Where are scripts stored

A

in m-files

26
Q

what does “type” do?

A

Display a script in the command window

27
Q

%

A

Creates a comment from % till the end of the line

28
Q

disp

A

A quick way to display things

29
Q

fprintf

A

A way to display things with formatting

30
Q

\n

A

newline character

31
Q

what is used to represent false

32
Q

what is used to represent true

A

any non-zero value

33
Q

what does an if-else statement do?

A

It chooses between two actions, only one action is executed