Home > Enterprise >  Matlab error: Array indices must be positive integers or logical values
Matlab error: Array indices must be positive integers or logical values

Time:11-10

I'm trying to do a normalized histogram on Matlab and I keep getting this error and I don't understand why

This is the part where I'm getting the error

    
    k;
    framecito= Frame(k);
    acum_normal= Histograma_acum_norm(framecito);
    Salida(k) = framecito*acum_normal;
end

Frame is a 1280*720 bits vector, Histograma_acum_norm is a 255 vector and Salida(k) well is the large of K

Any help is really useful, thank you

CodePudding user response:

Please provide a minimal reproducible example. Nevertheless, my guess is that index "k" or "framecito" are starting at value 0 or receiving some non-integer value, when vectors and arrays in MATLALB only have positive integer positions (ie.: Frame(1), Frame(2), Frame(3) or Histograma_acum_norm(1), Histograma_acum_norm(2) etc)

  • Related