The following matrix is created in MATLAB C46 311 linspace79
The following matrix is created in MATLAB: C=[4:6; 3:-1:1; linspace(7,9,3)]
Which statement represents the third column of C?
C( :, 2)
C( 1:3, 3)
[1 9 6]\'
C(2, 3)
Nee the code please
Solution
the given Matrix is C=[4:6; 3:-1:1; linspace(7,9,3)]
the symbol \";\" seperates two rows in a matrix
therefore now we have three rows as ; is specified twice in above matrix
they are
4:6 = row1 [4 5 6]
3:-1:1 =row2 [3 2 1] (-1 specifies decrement value from 3 to 1 of adjacent elements in a row)
LINSPACE Linearly spaced vector.
LINSPACE(X1, X2) generates a row vector of 100 linearly
equally spaced points between X1 and X2.
Note:along with X1 and X2 100 parts
LINSPACE(X1, X2, N) generates N points between X1 and X2.
For N < 2, LINSPACE returns X2.
Class support for inputs X1,X2:
float: double, single
example here third row of matrix c is linspace(7,9,3)
i.e ., X1=7 X2=9 N=3
therefore row3=[7 8 9]
finally we have
c=
4 5 6
C = 3 2 1
7 8 9
therefore column 3 is [6 1 9]
![The following matrix is created in MATLAB: C=[4:6; 3:-1:1; linspace(7,9,3)] Which statement represents the third column of C? C( :, 2) C( 1:3, 3) [1 9 6]\' C(2, The following matrix is created in MATLAB: C=[4:6; 3:-1:1; linspace(7,9,3)] Which statement represents the third column of C? C( :, 2) C( 1:3, 3) [1 9 6]\' C(2,](/WebImages/20/the-following-matrix-is-created-in-matlab-c46-311-linspace79-1043688-1761542592-0.webp)