MATLAB Flashcards

1
Q

what does matlab stand for?

A

matrix labratory

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

what must you create if you want to create a command sequence?

A

you must create a script or M-file

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

what does “clc” stand for?

A

clear all commands

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

What does MATLAB consider all numbers as?

A

floating point numbers

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

what does the “whos” command do?

A

tells you what variables have been defined in the workspace

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

when matlab accesses or stores information, what window does it use?

A

the current folder is used

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

T/F, can matlab variables have the same name as built in functions?

A

true

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

what does the “which” command do?

A

it allows you to check whether or not your variable name is the same as a built in matlab function

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

Does matlab read white space?

A

no

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

define exponent overflow

A

exponent overflow is when a number is above the MATLAB data range

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

what does a variable that is above the acceptable matlab data range appear as?

A

inf

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

define exponent underflow

A

exponent underflow occurs when a number is divided by zero

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

3/0 will return what?

A

inf

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

name how to use the linspace() command

A

(initial value, final value, number of values you want)

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

what does the linspace() command do?

A

the command returns a specified quantity of numbers evenly spaced between the initial and final values specified in the command

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

How does matlab process a matrix that is being called with numbers?

A

as a single column matrix where the numbers represent different elements

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

in matlab, is it valid to have a matrix that is empty?

A

yes it is valid to have an empty matrix

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

what should you look out for when expressing a variable in scientific notation with matlab?

A

it is important to omit blanks between the mantissa and the exponent

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

what is “6.02 e23” read as in matlab

A

6.02 and 10^23

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

what does “format long” do?

A

shows 14 points past the decimal

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

how does matlab print integers?

A

as integers

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

what does “format short” do?

A

shows 4 decimal points

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

what does “format bank” do?

A

shows 2 decimal points

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

does changing your display affect your data values?

A

no, matlab does its calculations with double point precision

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
how does matlab print numbers that are too large for its default format?
in scientific notation
26
what does "format long e" do?
it formats all numbers in scientific notation
27
what does "format +" do?
displays an array's elements as "+" or "-" based on whether or not they are positive or negative
28
what does the disp() function display?
it displays a number without its variable
29
what is the print format in matlab?
fprintf('text' , variables, ... )
30
what does the width field control in matlab?
the number of characters to be printed
31
what is the precision field in matlab?
preceded by a decimal, it controls the number of digits shown past the decimal point
32
what can matlab script files be saved as?
.m or .dat files
33
where are saved matlab files stored?
in the current directory
34
what is a script M-file?
a list of matlab statements
35
how do you use the rem() function in matlab?
remainder(numerator , denometer)
36
how can you find out what a function does in matlab/
type: help (function in question)
37
what does the sign() function do?
the sign() function returns -1 if a number is negative and a 1 if a number is positive
38
if: x = [1, 3 , 5] [a,b] = max(x) will be equal to what?
a= 5 b = 3
39
how does the mean() function work?
the mean function computes the average in each column
40
how does the sort() function work?
the sort() function will return the values of a matrix in ascending order
41
if: x = [1 3 5] [a,b] = size(x) will return what? what about size(x) ?
a =1 b = 3 1 3
42
how does size () = [a,b] work?
size
43
what does rng('default') do?
sets the random number seed to a default seed
44
what will rand(n) return?
a matrix with n rows and n columns with random numbers
45
what will rand(n,m) return?
a random matrix with n rows and m columns
46
what will rani(imax, n) return?
an matrix with n rows and n columns with values between 1 and imax)
47
what does randn(n) return?
gaussian random numbers between -1 and 1 with a mean of zero and a variance of 1
48
entering what command allows you to layer multiple figures in matlab?
the "hold on" command
49
what is the format of a standard 2D plot with a title and x/y labels?
plot(xvar, yvar) , title('title name'), xlabel('name'), ylabel('name')
50
what does the "hold off" command do?
matlab will stop layering plots
51
what is the default color for matlab graphs?
blue
52
what is the format for a plot with multiple lines in matlab?
plot(x,y1 , x,y2 ,.......)
53
what does the subplot command do?
the subplot command causes multiple graphs to be graphed onto 1 figure
54
what is the format for the subplot command?
the format for the subplot command is: subplot(row #s, Colums #s, # of figures)
55
what is the syntax for a 3D plot in matlab?
plot3(x,y,z)
56
define CPU
central processing unit
57
define ALU
arithmetic logic unit
58
where does the processor send data that it is instructed to add?
the processor sends the values to the ALU then the ALU sends them back to the processor and then the processor sends those values to memory
59
what are utilities
utilities are programs in the operating system that allow you to perform functions like: printing, copying files from folder to folder and listing files in a folder
60
what is a kernal?
the kernal manages interface between the hardware and software, the kernal is part of the operating system
61
what is an assembly language?
an assembly language is a computer language written in symbolic statements instead of binary
62
what does the link/load step do?
the link/load step links machine language to the object program then loads the program into memory
63
what is software?
software are programs that describe the steps we want the computer to perform
64
where are instructions and data stored in a computer
the memory
65
what is hardware?
hardware refers simply to computer equiptment
66
what is source code?
source code is a set of instruction in computer language that solve a specific problem
67
what is object code?
object code is the result of compilation on the source code
68
what are compilers and computer software also known as?
system software
69
can variable names start with an underscore in matlab?
no
70
what does the isvarname command do in matlab?
returns 1 if its a valid variable name returns 0 if its an invalid variable name
71
MATLAB stands for?
matrix laboratory
72
Which command is used to clear a command window?
clc
73
To determine whether an input is MATLAB keyword, command is?
iskeyword
74
Command used to display the value of variable x. a) displayx
disp(x)
75
Command is used to save command window text to file.
diary
76
To stop the execution of a MATLAB command, used keys?
ctrl+c
77
Which is the invalid variable name in MATLAB?
6x