Borrar filtros
Borrar filtros

I had a matrix s of size 4*12540, i want to use only 4*4 of this matrix how should i remove extra columns?

2 visualizaciones (últimos 30 días)
I had a matrix s of size 4*12540, i want to use only 4*4 of this matrix how should i remove extra columns?

Respuesta aceptada

Dishant Arora
Dishant Arora el 31 de Mzo. de 2014
A = yourArray(:,1:4);
or
yourArray(:,5:end) = [];

Más respuestas (1)

Joseph Cheng
Joseph Cheng el 31 de Mzo. de 2014
Editada: Joseph Cheng el 31 de Mzo. de 2014
If you want to completely remove these columns you can use [] ;
example:
Testmatrix = rand(4,12540);
Testmatrix(:,5:end) = [];%All rows in columns 5 through end are blank;

Categorías

Más información sobre Matrices and Arrays 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