I'm trying to find min variance (both value and index).
I have x# of product defects tracked over y# of days.
prod1 prod2 prod3...
Day1: 1 1 1
Day2: 1 2 2
I have arrays that store max & min defects, by product#.
minVar = maxDefect-minDefect gives me the min value. But try as I might, I can't figure out how to deterine the index #. minVar is the value. minVarProd is supposed to be the index.
The output needs to read:
The product with a minimum variance of _x_ is product _y_.
I can get the x but the y is lost on me. Pertinent code follows...
Thank you much in advance!
minVar = maxDefect[p] - minDefect [p]; //Calc & update minVar minVarProd = p;