Sunday, February 7, 2010

Matlab 7.5 Plp Generator Matlab Submatrix...given That A=[1 2 3 4 5 6;2 3 4 5 6 7;8 7 5 4 3 2];?

Matlab submatrix...given that A=[1 2 3 4 5 6;2 3 4 5 6 7;8 7 5 4 3 2];? - matlab 7.5 plp generator

How do I get the submatrix of the matrix, with four consecutive columns of the second column. with a loop. Ans. B = [2 3 4 5 3 4 5 6 7 5 4 3]

2 comments:

moushi said...

B = A (1:3,2:5)
Ie in 1.3, the need for the matrix B from the line 1 to read, in line 3
2:5 & B is in column 2, column 5
without the use of loops

jjasso5 said...

You can extract submatrices directly. No need to use loops.

B = A (1:3,2:5)

or
% Define rows and columns [CR]
[RC] = size (A)
B = A (1 r, 2: C-1)

The following website provides further examples

Post a Comment