How to delete Index which has 0 Value and replicate the matrix from start

2 次查看(过去 30 天)
Hello Everyone, I hope you are doing well. I have an array named as Dataset. I have replace 0 in for those values which has histogram count less than 50 percent of maximum value.
Now in my new array Dataset Has some Values which are equal to 0; I want to delete 0 in array and replicate the matrix from the start to complete matrix length for example the Dataset has length 137x1.
Batchdata=Dataset;
fig=figure; set(fig,'visible','off');
h=histogram(Batchdata,10000);
sumofbins=max(h.Values);
size_MP=round(50/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
close(fig);
Dataset(deleted_data_idx,:)=[];

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by