How can i extract small matrix from a big matrix

40 visualizaciones (últimos 30 días)
aiman
aiman el 7 de Nov. de 2022
Comentada: aiman el 7 de Nov. de 2022
Hello,
how can extract rows and columns from a big matrix using MATLAB ,For example I have 10*10 matrix and i only want first five rows and first column

Respuesta aceptada

BN
BN el 7 de Nov. de 2022
Editada: BN el 7 de Nov. de 2022
Let A be your example matrix (10x10), and you want to extract the first 5 rows of its first column. It's pretty easy:
A = rand(10,10); % creating random 10*10 matrix
B = A(1:5, 1); % extract first 5 rows of first column

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by