how to remove some row or column of a matrix at once?

Respuestas (2)

Arthur
Arthur el 6 de Nov. de 2012
Editada: Arthur el 6 de Nov. de 2012
a = zeros(100,100); %create 100x100 matrix
a(71:100,:) = []; %remove rows 71:100
Note you say row but the new size of your matrix removed columns
Here are two ways to remove columns:
x = x(:,1:70); %glass half full
or
x(:,71:end) = []; %glass half empty

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

eri
el 6 de Nov. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by