How to identify which iteration produces the desired output?

I have two inputs. One is a 1x91 matrix and the other is 91x1. The result is a 91x91 matrix. Then the values for the results that are below a threshold are discarded. I want to know which iterations were the ones that produced the desired values. How can I do this?
ri=linspace(5,50,91)/1000;
ro=ri+0.001;
l=linspace(10,100,91);
L=transpose(l);
T1=16;
T2=48;
ha=200;
hr=4000;
k=398;
dT1=35;
dT2=20;
LT=(dT1-dT2)/(log(dT1/dT2));
R=1./(ha.*pi.*2.*ri.*L)+log(ro./ri)./(2.*pi.*k.*L)+1./(hr.*pi.*2.*ro.*L);
UA=1./R;
qe=UA*LT;
indices = find(abs(qe)>24720);
qe(indices) = [];

4 Comments

I do not understand what you are asking? Your code does not have any obvious iterations.
ri=linspace(5,50,91)/1000;
ro=ri+0.001;
l=linspace(10,100,91);
L=transpose(l);
T1=16;
T2=48;
ha=200;
hr=4000;
k=398;
dT1=35;
dT2=20;
LT=(dT1-dT2)/(log(dT1/dT2));
R=1./(ha.*pi.*2.*ri.*L)+log(ro./ri)./(2.*pi.*k.*L)+1./(hr.*pi.*2.*ro.*L);
UA=1./R;
qe=UA*LT;
whos
Name Size Bytes Class Attributes L 91x1 728 double LT 1x1 8 double R 91x91 66248 double T1 1x1 8 double T2 1x1 8 double UA 91x91 66248 double dT1 1x1 8 double dT2 1x1 8 double ha 1x1 8 double hr 1x1 8 double k 1x1 8 double l 1x91 728 double qe 91x91 66248 double ri 1x91 728 double ro 1x91 728 double
mask = abs(qe)>24720;
qe(mask) = [];
[r, c] = find(~mask);
r(1:5)
ans = 5×1
1 2 3 4 5
c(1:5)
ans = 5×1
1 1 1 1 1
imshow(~mask)
Sorry for the akward phrasing. That is exactly what I wanted.

Sign in to comment.

Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!