Borrar filtros
Borrar filtros

Curve Fitting on Histogram

6 visualizaciones (últimos 30 días)
Ahmed Ismail
Ahmed Ismail el 29 de Sept. de 2016
Comentada: dbmn el 29 de Sept. de 2016
Hi, so I am trying to fit a polynomial curve on the histogram data, but I have problem in the implementation. I am using the function 'histfit' like so:
[j,qout] = hist(data,700);
h = histfit(data, 700, 'beta');
but it's coming with an error, stating:
All values must be within the closed interval [0,1].
I don't see such an implementation on the documentation of the function. Help would be much appreciated.

Respuesta aceptada

dbmn
dbmn el 29 de Sept. de 2016
Hi Ahmed,
if I use
data = rand(1e6,1);
it works flawlessly, but if I use
data = 2*rand(1e6,1);
I get the same error. As the error suggests, the function only works on Data Ranges [0,1].
  2 comentarios
Ahmed Ismail
Ahmed Ismail el 29 de Sept. de 2016
Ah, now I understand, so is there an alternative for values that exceed 1, or is it a simpler option just to normalise the histogram?
dbmn
dbmn el 29 de Sept. de 2016
data = data./max(data)
should normalize your data. Maybe check first if max(data)>0 :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by