Delete the values from array using histogram

3 次查看(过去 30 天)
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;

采纳的回答

Voss
Voss 2022-6-11
arr(deleted_data_idx,:) = [];

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Distribution Plots 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by