Skip to content

Commit 5fc4084

Browse files
committed
More warning fixes.
1 parent eb53c61 commit 5fc4084

File tree

8 files changed

+133
-134
lines changed

8 files changed

+133
-134
lines changed

dplot.m

+11-12
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
w = w(:);
2828
beta = beta(:);
29-
n = length(w);
3029
z = z(:);
3130

3231
% Parse input
@@ -47,12 +46,12 @@
4746
end
4847

4948
% Integer arguments must be converted to specific values
50-
if (length(R)==1) & (R == round(R))
49+
if (length(R)==1) && (R == round(R))
5150
m = R+2;
5251
R = linspace(0,1,m);
5352
R([1,m]) = [];
5453
end
55-
if (length(theta)==1) & (theta == round(theta))
54+
if (length(theta)==1) && (theta == round(theta))
5655
m = theta+1;
5756
theta = linspace(0,2*pi,m);
5857
theta(m) = [];
@@ -66,10 +65,10 @@
6665
ax = [findobj(fig,'tag','PhysicalAxes');...
6766
findobj(fig,'tag','CanonicalAxes')];
6867
if length(ax)==2
69-
draw2 = logical(1);
68+
draw2 = true;
7069
vis = get(ax,'vis');
7170
else
72-
draw2 = logical(0);
71+
draw2 = false;
7372
ax = gca;
7473
vis = {'on'};
7574
end
@@ -98,7 +97,7 @@
9897
for j = 1:length(R)
9998
% Start with evenly spaced theta
10099
tp = linspace(0,2*pi,20)';
101-
new = logical(ones(length(tp),1));
100+
new = true(length(tp),1);
102101
wp = NaN*new;
103102

104103
% The individual points will be shown as they are found
@@ -111,9 +110,9 @@
111110

112111
% Adaptively refine theta to make smooth curve
113112
iter = 0;
114-
while (any(new)) & (iter < maxrefn)
113+
while (any(new)) && (iter < maxrefn)
115114
drawnow
116-
zp = R(j)*exp(i*tp(new));
115+
zp = R(j)*exp(1i*tp(new));
117116
neww = dmap(zp,w,beta,z,c,qdat);
118117
wp(new) = neww;
119118
iter = iter + 1;
@@ -131,7 +130,7 @@
131130

132131
% Set the lines to be solid
133132
set(linh(j,1),'erasemode','back')
134-
set(linh(j,1),'marker','none','linestyle','-','user',R(j)*exp(i*tp))
133+
set(linh(j,1),'marker','none','linestyle','-','user',R(j)*exp(1i*tp))
135134
if draw2
136135
% Replace the points with (hopefully) a smooth circle
137136
tp = linspace(0,2*pi,101);
@@ -147,8 +146,8 @@
147146
linh = gobjects(length(theta),2);
148147
for j = 1:length(theta)
149148
Rp = linspace(0,1,14)';
150-
zp = Rp*exp(i*theta(j));
151-
new = logical(ones(length(zp),1));
149+
zp = Rp*exp(1i*theta(j));
150+
new = true(length(zp),1);
152151
wp = NaN*new;
153152

154153
% The individual points will be shown as they are found
@@ -161,7 +160,7 @@
161160

162161
% Adaptively refine to make smooth curve
163162
iter = 0;
164-
while (any(new)) & (iter < maxrefn)
163+
while (any(new)) && (iter < maxrefn)
165164
drawnow
166165
neww = dmap(zp(new),w,beta,z,c,qdat);
167166
wp(new) = neww;

hpplot.m

+12-12
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
end
5151

5252
% Integer arguments must be converted to specific values
53-
if (length(re)==1) & (re == round(re))
53+
if (length(re)==1) && (re == round(re))
5454
if re < 1
5555
re = [];
5656
elseif re < 2
@@ -62,7 +62,7 @@
6262
re = linspace(z(1)-dre,z(n-1)+dre,m);
6363
end
6464
end
65-
if (length(im)==1) & (im == round(im))
65+
if (length(im)==1) && (im == round(im))
6666
if length(re) < 2
6767
im = linspace(0,4,im+1);
6868
im(1) = [];
@@ -79,10 +79,10 @@
7979
ax = [findobj(fig,'tag','PhysicalAxes');...
8080
findobj(fig,'tag','CanonicalAxes')];
8181
if length(ax)==2
82-
draw2 = logical(1);
82+
draw2 = true;
8383
vis = get(ax,'vis');
8484
else
85-
draw2 = logical(0);
85+
draw2 = false;
8686
ax = gca;
8787
vis = {'on'};
8888
end
@@ -115,10 +115,10 @@
115115
linh = gobjects(length(re),2);
116116
for j = 1:length(re)
117117
% Start evenly spaced
118-
zp = re(j) + i*[linspace(0,y2,15) Inf].';
119-
new = logical(ones(size(zp)));
118+
zp = re(j) + 1i*[linspace(0,y2,15) Inf].';
119+
new = true(size(zp));
120120
new(end) = 0;
121-
wp = repmat(NaN,length(zp),1);
121+
wp = NaN(length(zp),1);
122122
wp(end) = w(n);
123123

124124
% The individual points will be shown as they are found
@@ -131,7 +131,7 @@
131131

132132
% Adaptive refinement to make smooth curve
133133
iter = 0;
134-
while (any(new)) & (iter < maxrefn)
134+
while (any(new)) && (iter < maxrefn)
135135
drawnow
136136
neww = hpmap(zp(new),w,beta,z,c,qdat);
137137
wp(new) = neww;
@@ -165,10 +165,10 @@
165165
linh = gobjects(length(im),2);
166166
for j = 1:length(im)
167167
% Start evenly spaced
168-
zp = [-Inf linspace(z1,z2,15) Inf].' + i*im(j);
169-
new = logical(ones(size(zp)));
168+
zp = [-Inf linspace(z1,z2,15) Inf].' + 1i*im(j);
169+
new = true(size(zp));
170170
new([1 end]) = 0;
171-
wp = repmat(NaN,length(zp),1);
171+
wp = NaN(length(zp),1);
172172
wp([1 end]) = w(n);
173173

174174
% The individual points will be shown as they are found
@@ -181,7 +181,7 @@
181181

182182
% Adaptive refinement to make smooth curve
183183
iter = 0;
184-
while (any(new)) & (iter < maxrefn)
184+
while (any(new)) && (iter < maxrefn)
185185
drawnow
186186
neww = hpmap(zp(new),w,beta,z,c,qdat);
187187
wp(new) = neww;

plotpoly.m

+7-7
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
R = max(lim(2)-lim(1),lim(4)-lim(3));
4343

4444
% Renumber to start with two finite vertices
45-
first = min(find(~atinf & ~atinf([2:n,1])));
45+
first = find(~atinf & ~atinf([2:n,1]), 1 );
4646
if isempty(first),
4747
error('There must be two consecutive finite vertices.')
4848
end
@@ -76,7 +76,7 @@
7676
theta = theta - pi/2;
7777
end
7878
% Make label; markers will be added last
79-
pos = w(j) + .035*R*exp(i*theta);
79+
pos = w(j) + .035*R*exp(1i*theta);
8080
%%lblh(j,1) = plot(real(w(j)),imag(w(j)),'.','markersize',12);
8181
lblh(j,2) = text(real(pos),imag(pos),int2str(renum(j)),...
8282
'ver','mid','hor','cen');
@@ -91,29 +91,29 @@
9191
else
9292
% Unbounded edge (first of two consecutive)
9393
ang = ang-pi*beta(j);
94-
z = [w(j);w(j)+R*exp(i*ang)];
94+
z = [w(j);w(j)+R*exp(1i*ang)];
9595
edgeh(j) = plot(real(z),imag(z),'-','linewid',lw);
9696
% Make first label outside axes box
9797
if nargin == 3
9898
theta = ang;
9999
Rx = (lim(1:2) - real(w(j))) / (cos(theta)+eps*(cos(theta)==0));
100100
Ry = (lim(3:4) - imag(w(j))) / (sin(theta)+eps*(sin(theta)==0));
101101
RR = [Rx,Ry];
102-
pos = w(j) + (min(RR(RR>0))+.07*R)*exp(i*theta);
102+
pos = w(j) + (min(RR(RR>0))+.07*R)*exp(1i*theta);
103103
str = sprintf('%i (inf)',renum(j+1));
104104
lblh(j+1,1) = text(real(pos),imag(pos),str,'ver','mid','hor','cen');
105105
end
106106

107107
% Second unbounded edge
108108
ang = ang-pi*beta(jp1);
109-
z = [w(rem(j+1,n)+1)-R*exp(i*ang);w(rem(j+1,n)+1)];
109+
z = [w(rem(j+1,n)+1)-R*exp(1i*ang);w(rem(j+1,n)+1)];
110110
edgeh(j+1) = plot(real(z),imag(z),'-','linewid',lw);
111111
if nargin == 3
112112
theta = ang + pi;
113113
Rx = (lim(1:2) - real(z(2))) / (cos(theta)+eps*(cos(theta)==0));
114114
Ry = (lim(3:4) - imag(z(2))) / (sin(theta)+eps*(sin(theta)==0));
115115
RR = [Rx,Ry];
116-
pos = z(2) + (min(RR(RR>0))+.07*R)*exp(i*theta);
116+
pos = z(2) + (min(RR(RR>0))+.07*R)*exp(1i*theta);
117117
str = sprintf('%i (inf)',renum(j+1));
118118
lblh(j+1,2) = text(real(pos),imag(pos),str,'ver','mid','hor','cen');
119119
end
@@ -129,7 +129,7 @@
129129
if any( abs([beta(n)-1 beta(1) beta(2)-1]) < 3*eps)
130130
theta = theta + pi -(beta(1)+1)*pi/2;
131131
end
132-
pos = w(1) + .035*R*exp(i*theta);
132+
pos = w(1) + .035*R*exp(1i*theta);
133133
%%lblh(1,1) = plot(real(w(1)),imag(w(1)),'.','markersize',12);
134134
lblh(1,2) = text(real(pos),imag(pos),int2str(renum(1)),...
135135
'ver','mid','hor','cen');

0 commit comments

Comments
 (0)