Delete the values from array using histogram

5 ビュー (過去 30 日間)
Med Future
Med Future 2022 年 6 月 10 日
回答済み: Voss 2022 年 6 月 11 日
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 Center および File ExchangeHistograms についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by