How to select the column of matrix?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Chetan Fadnis
am 16 Mär. 2022
Kommentiert: Star Strider
am 16 Mär. 2022
I have a 10*5 matrix, say A.
I calculate vecnorm, B=vecnorm(A), which gives me values of norm-2 of each column, of order (1*5)
Now I have to select that particular column which highest value of vecnorm. Final matrix will be thus 10*1.
0 Kommentare
Akzeptierte Antwort
Star Strider
am 16 Mär. 2022
Try this —
M = randn(10,5) % Create Matrix
Mv = vecnorm(M)
[mxMv,col] = max(Mv)
Desired_Output = M(:,col)
.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra 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!