Matrix Extraction based on summation.

1 Ansicht (letzte 30 Tage)
Fayyaz
Fayyaz am 7 Apr. 2015
Beantwortet: John D'Errico am 7 Apr. 2015
Hi.
I have 81*81 matrix. I need to extract a matrix from that, for example of order 81*2, which include two columns i.e. the 34th column and the sum of 22,39 and 59 columns.
I will be really thankful for any suggestion or help. Thanks

Akzeptierte Antwort

John D'Errico
John D'Errico am 7 Apr. 2015
Easy peasy.
B = A(:,[34 22 39 59])*[1 0 0 0;0 1 1 1]';

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