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 vues (au cours des 30 derniers jours)
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?

Réponse acceptée

Dishant Arora
Dishant Arora le 31 Mar 2014
A = yourArray(:,1:4);
or
yourArray(:,5:end) = [];

Plus de réponses (1)

Joseph Cheng
Joseph Cheng le 31 Mar 2014
Modifié(e) : Joseph Cheng le 31 Mar 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;

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by