How to select the column of matrix?
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Star Strider
2022 年 3 月 16 日
Try this —
M = randn(10,5) % Create Matrix
Mv = vecnorm(M)
[mxMv,col] = max(Mv)
Desired_Output = M(:,col)
.
2 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!