Delete the values from array using histogram
3 views (last 30 days)
Show older comments
i have the following data ,shape of 79787x4, I have taken the 2nd dimension and create histogram and delte the value which are less then 13.
now, the output shape from this code is 79296x1 . I want to delete the corresponding indexes(rows) from remaining column which are delete from this histogram in the original dataset
in the following code the deleted_data_idx shows the deleted index
Batchdata=arr(:,2);
figure;
h=histogram(Batchdata,10000);
sumofbins=max(h.Values);
size_MP=round(0.2/100*sumofbins);
ValueofHistogram= h.Values;
Bindata=h.Data;
Binedges=h.BinEdges;
Binedges(end) = Inf;
deleted_data_idx = false(size(Bindata));
for i=1: length(ValueofHistogram)
if ValueofHistogram(i)<size_MP;
deleted_data_idx(Bindata >= Binedges(i) & Bindata < Binedges(i+1)) = true;
end
end
Bindata(deleted_data_idx) = [];
incomingdata= Bindata;
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Data Distribution Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!