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
Q

how does matlab print numbers that are too large for its default format?

A

in scientific notation

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

what does “format long e” do?

A

it formats all numbers in scientific notation

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

what does “format +” do?

A

displays an array’s elements as “+” or “-“ based on whether or not they are positive or negative

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

what does the disp() function display?

A

it displays a number without its variable

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

what is the print format in matlab?

A

fprintf(‘text’ , variables, … )

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

what does the width field control in matlab?

A

the number of characters to be printed

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

what is the precision field in matlab?

A

preceded by a decimal, it controls the number of digits shown past the decimal point

32
Q

what can matlab script files be saved as?

A

.m or .dat files

33
Q

where are saved matlab files stored?

A

in the current directory

34
Q

what is a script M-file?

A

a list of matlab statements

35
Q

how do you use the rem() function in matlab?

A

remainder(numerator , denometer)

36
Q

how can you find out what a function does in matlab/

A

type: help (function in question)

37
Q

what does the sign() function do?

A

the sign() function returns -1 if a number is negative and a 1 if a number is positive

38
Q

if: x = [1, 3 , 5]
[a,b] = max(x) will be equal to what?

A

a= 5
b = 3

39
Q

how does the mean() function work?

A

the mean function computes the average in each column

40
Q

how does the sort() function work?

A

the sort() function will return the values of a matrix in ascending order

41
Q

if: x = [1 3 5]
[a,b] = size(x) will return what?

what about size(x) ?

A

a
=1

b
= 3
1 3

42
Q

how does size () = [a,b] work?

A

size

43
Q

what does rng(‘default’) do?

A

sets the random number seed to a default seed

44
Q

what will rand(n) return?

A

a matrix with n rows and n columns with random numbers

45
Q

what will rand(n,m) return?

A

a random matrix with n rows and m columns

46
Q

what will rani(imax, n) return?

A

an matrix with n rows and n columns with values between 1 and imax)

47
Q

what does randn(n) return?

A

gaussian random numbers between -1 and 1
with a mean of zero and a variance of 1

48
Q

entering what command allows you to layer multiple figures in matlab?

A

the “hold on” command

49
Q

what is the format of a standard 2D plot with a title and x/y labels?

A

plot(xvar, yvar) , title(‘title name’), xlabel(‘name’), ylabel(‘name’)

50
Q

what does the “hold off” command do?

A

matlab will stop layering plots

51
Q

what is the default color for matlab graphs?

A

blue

52
Q

what is the format for a plot with multiple lines in matlab?

A

plot(x,y1 , x,y2 ,…….)

53
Q

what does the subplot command do?

A

the subplot command causes multiple graphs to be graphed onto 1 figure

54
Q

what is the format for the subplot command?

A

the format for the subplot command is:
subplot(row #s, Colums #s, # of figures)

55
Q

what is the syntax for a 3D plot in matlab?

A

plot3(x,y,z)

56
Q

define CPU

A

central processing unit

57
Q

define ALU

A

arithmetic logic unit

58
Q

where does the processor send data that it is instructed to add?

A

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
Q

what are utilities

A

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
Q

what is a kernal?

A

the kernal manages interface between the hardware and software, the kernal is part of the operating system

61
Q

what is an assembly language?

A

an assembly language is a computer language written in symbolic statements instead of binary

62
Q

what does the link/load step do?

A

the link/load step links machine language to the object program then loads the program into memory

63
Q

what is software?

A

software are programs that describe the steps we want the computer to perform

64
Q

where are instructions and data stored in a computer

A

the memory

65
Q

what is hardware?

A

hardware refers simply to computer equiptment

66
Q

what is source code?

A

source code is a set of instruction in computer language that solve a specific problem

67
Q

what is object code?

A

object code is the result of compilation on the source code

68
Q

what are compilers and computer software also known as?

A

system software

69
Q

can variable names start with an underscore in matlab?

A

no

70
Q

what does the isvarname command do in matlab?

A

returns 1 if its a valid variable name
returns 0 if its an invalid variable name

71
Q

MATLAB stands for?

A

matrix laboratory

72
Q

Which command is used to clear a command window?

A

clc

73
Q

To determine whether an input is MATLAB keyword, command is?

A

iskeyword

74
Q

Command used to display the value of variable x.
a) displayx

A

disp(x)

75
Q

Command is used to save command window text to file.

A

diary

76
Q

To stop the execution of a MATLAB command, used keys?

A

ctrl+c

77
Q

Which is the invalid variable name in MATLAB?

A

6x