Hello I need a code that gives me the local minimum of a histogram please ?

3 views (last 30 days)
AbdelRahman Mostafa
AbdelRahman Mostafa on 21 Apr 2022
I created 12 histograms for 12 frames and I need to get the local minimums of these histograms.

Answers (1)

Mathieu NOE
Mathieu NOE on 21 Apr 2022
hello
maybe this
the local minima are the red diamonds
x = randn(1000,1);
h = histogram(x);
Values = h.Values;
BinCounts = h.BinCounts;
BinEdges = h.BinEdges;
BinWidth = h.BinWidth;
centers = BinEdges(2:end) - BinWidth/2;
% find min values
ind = islocalmin(Values);
hold on
plot(centers(ind),Values(ind),'dr');
hold off
  12 Comments
AbdelRahman Mostafa
AbdelRahman Mostafa on 10 May 2022
I am a masters student and my thesis is about image processing. I just needed to know how to get the local minimums to be able to continue my thesis. Now you know why I need it. If you can help good if you cant then dont talk to me that way. Thank you

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!