How to get minimum element of matrix and corresponding row elements

2 views (last 30 days)
Hello Dears, I have matrix A of 3X10 as below:
A=[0.250 1.000 0.111 0.040 16.000 4.000 0.360 1.563 0.111 0.563 0.000 4.000 1.000 0.360 0.000 1.000 0.160 0.063 0.028 1.000 0.250 9.000 1.778 0.040 9.000 2.250 0.360 0.563 0.444 3.063]
norm of each row (N) as follows:
N= [23.9980 7.6110 26.7480]
I want to find minimum element of N (7.6110 in this case) and corresponding row elements in matrix A.
In this case minimum element in N is 7.6110 which is appears in 2nd row, and corresponding 2nd row elements in A:[0.000 4.000 1.000 0.360 0.000 1.000 0.160 0.063 0.028 1.000]
Pl some one help how to do this. Thanks in advance

Accepted Answer

Roger Stafford
Roger Stafford on 10 Jan 2015
Edited: Roger Stafford on 10 Jan 2015
N = sqrt(sum(A.^2,2)); % I assume you mean the L2 norm
[Nmin,ix] = min(N);
Amin = A(ix,:);
where Nmin is the minimum row norm and Amin is the corresponding row of A.

More Answers (0)

Categories

Find more on Robust Control Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!