Delete the values from array using histogram

2 views (last 30 days)
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;

Accepted Answer

Voss
Voss on 11 Jun 2022
arr(deleted_data_idx,:) = [];

More Answers (0)

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!