Hi,
I have a set of array (1×100 double) representing a set of threshold values and data of (136×136 double). What I want to do is based on the value of each element in the set of threshold value, the data of (136×136 double) will update independently until the last value of the threshold. Then, i want to make it the updated data as 1×100 cell. How can i do this?
I have try to wrote a code on it, but its look like the data is not updated according to the set of threshold values.
loadThres = load ('Pth_array.mat'); % load the threshold values
Pth = loadThres.Pth; load_img = load ('img2.mat'); % load the data
img2 = load_img.img2; Resolution=136;for j=1:100 % get each threshold value
Val(1,j)=Pth(1,j); for m = 1:Resolution; for n = 1:Resolution; if img2(m,n)<Val(1,j);img2(m,n)=0;end %threshold
if img2(m,n)>=Val(1,j);img2(m,n)=1;end end end array{j}=img2; end
Best Answer