Help with index for maximum value
Mostra commenti meno recenti
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 Commenti
Walter Roberson
il 14 Feb 2024
Modificato: Walter Roberson
il 14 Feb 2024
type fracts
Brantosaurus
il 14 Feb 2024
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Introduction to Installation and Licensing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!