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 次查看(过去 30 天)
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?

采纳的回答

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

更多回答(1 个)

Joseph Cheng
Joseph Cheng 2014-3-31
编辑:Joseph Cheng 2014-3-31
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;

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by