Borrar filtros
Borrar filtros

OVERLAY OF HISTOGRAMS error in variables

1 visualización (últimos 30 días)
sofia cirne
sofia cirne el 20 de Jun. de 2017
Comentada: aditya sahu el 4 de Oct. de 2017
im trying to overlay to histograms in one graph, but i have this error taht i cant understand.
x = handles.grey;
y = handles.binaria
nbins = 50;
bound = 1;
bins = linspace(-bound,bound,nbins);
% %b = histeq(X);
% first histogram
y1 = hist(x, bins);
% second histogram
y2 = hist(y, bins);
% overlay histograms
bar(y1.');
hold on;
bar(y2.','r');
the error given is
Error using hist (line 48)
Input arguments must be numeric.
Error in untitled>histograma_Callback (line 112)
y2 = hist(y, bins);
y is a black and white image, binary, it was converted to double, however it doesnt work. thank you!

Respuestas (1)

Image Analyst
Image Analyst el 20 de Jun. de 2017
Editada: Image Analyst el 20 de Jun. de 2017
What does this say
whos y
Also, maybe you can try imhist(), histogram(), or histcounts().
Anyway, it makes no sense to have 50 bins, or actually bin edges which is what you're passing in, for a binary image. You will have no counts except in the bins for 0 and 1.
  3 comentarios
Image Analyst
Image Analyst el 20 de Jun. de 2017
Are you going to answer my question about "whos y", or not?
And, like I said, use imhist() and the problem should go away.
counts = imhist(y);
bar(counts, 'BarWidth', 1)
aditya sahu
aditya sahu el 4 de Oct. de 2017
are you trying for pdh analysis

Iniciar sesión para comentar.

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by