Help with index for maximum value
Afficher commentaires plus anciens
I have an 2D array of data containing product fractions. The column index is associated with a mix ratio. The row index is associated with the product species. I can find the maximum fraction value for a specific species, but the mix ratio (and index) is wrong.
My code gives:
species max-frac mix-ratio
*H2 0.96220083 0.3
H2O 0.6870072 6.5
*OH 0.12253145 8
*O2 0.098079432 10
*H 0.041959177 10
*O 0.023207462 10
HO2 0.00045286 10
H2O2 6.51818E-05 10
O3 1.13457E-06 10
But the correct answer should be:
species max-frac mix-ratio
*H2 0.96220083 0.3
H2O 0.6870072 8
*OH 0.12253145 10
*O2 0.098079432 10
*H 0.041959177 6.5
*O 0.023207462 10
HO2 0.00045286 10
H2O2 6.51818E-05 10
O3 1.13457E-06 10
Any help sorting this out would be much appreciated.
format long g
fracts()
2 commentaires
Walter Roberson
le 14 Fév 2024
Modifié(e) : Walter Roberson
le 14 Fév 2024
type fracts
Brantosaurus
le 14 Fév 2024
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!