Filter löschen
Filter löschen

fastest way to divide a matrix columns into two matrices ?

2 Ansichten (letzte 30 Tage)
farzad
farzad am 20 Mär. 2015
Kommentiert: farzad am 20 Mär. 2015
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 ?

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 20 Mär. 2015
Bearbeitet: Azzi Abdelmalek am 20 Mär. 2015
%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

Weitere Antworten (0)

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by