Week 5 ENCMP 100 Flashcards

1
Q

What is a vector

A

A vector is a special case of a matrix in which one of the dimensions is 1

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

What does the ‘char’ function do?

A

the function char converts an integer to the character equivalent

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

What does size() do?

A

size returns the # of rows and columns for a vector or matrix

Rows x Columns

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

What is the default data type in MATLAB?

A

The default data type is double

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

What does ‘subplot’ do?

A

The subplot function creates a matrix (or vector) in a
Figure Window so that multiple plots can be viewed at
once

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

What data types are supported in MATLAB

A

Real numbers, Integers, Characters and Strings, Logical & Complex Numbers

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

Abs means what?

A

Absolute value

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

Function ‘complex’ creates what?

A

A complex array

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

Conj creates what

A

Complex conjungate

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

What does ‘i’ do?

A

It is a imaginary unit

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

What does ‘imag’ do?

A

It is the imaginary part of a complex number

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

What does the colon operator do?

A

Colon operator: iterates through values in the form first:step:last
e.g. 5:3:14 returns vector [5 8 11 14]

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

What does .* do?

A

It is an array multiplication operator

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

How do you do array division?

A

array division: A ./ B, A .\ B

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

How do you do array exponential

A

array exponentiation A .^ 2

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

What is matrix multiplication

A

In MATLAB, the multiplication operator * performs matrix
multiplication

In order to be able to multiply a matrix A by a matrix B, the number of
columns of A must be the same as the number of rows of B

If the matrix A has dimensions m x n, that means that matrix B must
have dimensions n x something; we’ll call it p
- In mathematical notation, [A]m x n [B]n x p
-We say that the inner dimensions must be the same

17
Q

What is the difference between a matrix and array multi platoon

A

Confusing matrix multiplication and array multiplication. Array
operations, including multiplication, division, and exponentiation, are
performed term by term (so the arrays must have the same size); the
operators are .*, ./, .\, and .^. For matrix multiplication to be possible,
the inner dimensions must agree and the operator is *.

18
Q

What is ASCII

A

standard ASCII has 128 characters; integer equivalents are 0-127

19
Q

Is subplot row wise or columnwise

A

It is rowwise

20
Q

What is Linear Indexing

A

Linear indexing: only using one index into a
matrix (MATLAB will unwind it column-by
column)
 Note, this is not generally recommended

21
Q

What can be used to determine the number of elements in a vector

A

Instead, use the function length or numel to
determine the number of elements in a vector, and the function size
for a matrix:
len = length(vec); [r, c] = size(mat);

22
Q

What does the plot function do?

23
Q

The ASCII codes for the letters a and d are 97 and 100, respectively. What are the values of v1 and s1, respectively?
v1 = ‘a’+3;
s1 = [‘a’ 100];

24
Q

What is a sinusoid function?

A

https://dademuch.com/2020/10/07/the-sinusoidal-characteristics-in-discrete-time-matlab/

25
What is the dimensional limit for array operations?
this means the matrices must have the same dimensions
26
Assume the following array: c=[1 2;5 6;9 10]; What is the contents of the following array: d = c(:,3)?
Not possible because the column number is outside possible options for the matrix
27
my_area = 12; str = ['The area is' num2str(my_area)]; disp(str);
The area is12
28
Variable names must begin with what?
Letters of the alphabet
29
How do I have the program check what the limit is for the length of the variable name
the built-in function namelengthmax tells what the | limit is for the length of a variable name
30
``` arr1 = [0 2 1 0; 3 4 0 5; 10 2 1 7]; s = size(arr1) ```
[3,4]