Storing matrix value

1 visualizzazione (ultimi 30 giorni)
FIR
FIR il 23 Mag 2012
I have a matrix A =
6 2 3
7 9 0
8 3 4
i have found the minimum value from 1st row,
M=min(A(1,:))
i get value as M=2,now i want to store other values in that column which is 9 and 3 in a variable Z,
so i will have
Z=
9
3
please help

Risposta accettata

Andrei Bobrov
Andrei Bobrov il 23 Mag 2012
[id,id]=min(A(1,:))
Z = A(2:end,id)

Più risposte (1)

Wayne King
Wayne King il 23 Mag 2012
A = [ 6 2 3
7 9 0
8 3 4];
[minval,I] = min(A(1,:));
z = A(2:end,I);

Categorie

Scopri di più su Statistics and Machine Learning Toolbox in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by