Effacer les filtres
Effacer les filtres

if i have three matrix i want to return some one according to vaue

2 vues (au cours des 30 derniers jours)
Firas Al-Kharabsheh
Firas Al-Kharabsheh le 25 Avr 2016
Commenté : Azzi Abdelmalek le 25 Avr 2016
if i have
S1 = [ 1 0 0 1
1 1 1 0
0 1 0 1 ]
S2 = [ 1 1 0 1
0 1 0 1
1 1 0 0]
S3 = [ 1 1 1 1
0 0 1 1
1 0 1 0]
AND suppose that these matrix have these value
5 4 7
where 5 for the S1 , 4 FOR S2 , 7 FOR S3
according to these value i want to return the second min value where its the 5
then the result will be
s1 = [ 1 0 0 1
1 1 1 0
0 1 0 1 ]

Réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 25 Avr 2016
S1 = [ 1 0 0 1
1 1 1 0
0 1 0 1 ]
S2 = [ 1 1 0 1
0 1 0 1
1 1 0 0]
S3 = [ 1 1 1 1
0 0 1 1
1 0 1 0]
v={S1,S2,S3}
idx=[5 4 7]
[~,ii]=min(idx)
out=v{ii}
  2 commentaires
Firas Al-Kharabsheh
Firas Al-Kharabsheh le 25 Avr 2016
i need the second min value which equal for 5 which is the S1
Azzi Abdelmalek
Azzi Abdelmalek le 25 Avr 2016
[~,ii]=sort(idx),
out=v{ii}

Connectez-vous pour commenter.

Catégories

En savoir plus sur Operators and Elementary Operations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by