Chapter 2 : Numeric, Cell, and Structure Arrays Flashcards

1
Q

v(:)

A

represents all the row or oclumn elements of hte vector v

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

v(2:5)

A

represents the second through fifth elements; that is v(2), v(3), v(4), v(5)

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

A(:,3)

A

denotes all the elements in the third column of matrix A

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

A(3,:)

A

denotes all the elements in the thrid row of A

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

A(:,2:5)

A

denotes all the elements in the second through fifth columns of A

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

A(2:3,1:3)

A

denotes all the elements in the second and third rows that are also in the first through third columns

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

v=A(:)

A

creates a vector v consisting of all the columns of A stacked from first to last

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

A(end,:)

A(:,end)

A

denotes the last row in A

denotes the last column in A

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

sum(A)

A

sums the elements in each column of the array A and returns a row vector containing the sums

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

what is the command for dot and cross product?

A

dot(A,B)

cross(A,B)

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

what is the command for finding te roots of a polynomial

A

roots (a)

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

how do you create a polynomial in matlab?

A

type in the coefficients in decending order of powers of x. you do not need to type in any variables

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

what is the command to create a polynomial with specific roots?

A

p = poly([root, root])

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

what is the command for evaluating a polynomial, a , at specific values x

A

polyval(a,x)

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

what is the command for a graphical display of a cell’s array in the form of a grid?

A
B = { [#,#] , [#,#] }
or A(1,1) = #
A(1,2) = #
etc
then type
cellplot(A)
cellplot(B)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

how do you create a structure array?

A

title.subdivision_name = ‘actual_name’
for a second column type
title(2).subdivision_name = ‘actual_name’