finding the maximum of values after and before a specific value
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
SSG_newbiecoder
il 19 Dic 2017
Commentato: SSG_newbiecoder
il 22 Dic 2017
hello, I have a doubt.Is it possible to find out the maximum values before and after the ith element in an array?
2 Commenti
Risposta accettata
Birdman
il 19 Dic 2017
One approach:
a=randi([1 10],1,10);
ind=4;%4th element in a vector is chosen
a1=a(1:ind-1);
a2=a(ind+1,end);
max(a1)
max(a2)
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Multidimensional Arrays in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!