Help with index for maximum value
Mostrar comentarios más antiguos
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 comentarios
Walter Roberson
el 14 de Feb. de 2024
Editada: Walter Roberson
el 14 de Feb. de 2024
type fracts
Brantosaurus
el 14 de Feb. de 2024
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Introduction to Installation and Licensing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!