fastest way to divide a matrix columns into two matrices ?

2 次查看(过去 30 天)
Hi All
I have an m*n matrix
I want to take out the fifth column (all the m rows) to one matrix , and alll of the other collumns , to another , how to do that ?

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2015-3-20
编辑:Azzi Abdelmalek 2015-3-20
%If A is your matrix
A=randi(10,5,8) % example
c5=A(:,5) % the fifth column
B=A(:,[1:4 6:m]) % remaining matrix

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by