Skip to content

Commit e252071

Browse files
committed
updated warning
1 parent 94fec53 commit e252071

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

EXAMPLES.mlx

25.2 KB
Binary file not shown.

fixed_point_iteration.m

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,6 @@
114114
i = i+1;
115115

116116
end
117-
118-
% displays warning if maximum number of iterations reached
119-
if (i == imax) && warnings
120-
warning(strcat('The method failed after n=',num2str(imax),...
121-
' iterations.'));
122-
end
123117

124118
% returns converged fixed point along with intermediate fixed point
125119
% estimates
@@ -158,16 +152,19 @@
158152
i = i+1;
159153

160154
end
161-
162-
% displays warning if maximum number of iterations reached
163-
if (i == imax) && warnings
164-
warning(strcat('The method failed after n=',num2str(imax),...
165-
' iterations.'));
166-
end
167155

168156
% returns converged fixed point
169157
c = x_new;
170158

171159
end
160+
161+
% ---------------------------------------------------------
162+
% Displays warning if maximum number of iterations reached.
163+
% ---------------------------------------------------------
164+
165+
if (i == imax) && warnings
166+
warning(strcat('The method failed after i=',num2str(imax),...
167+
' iterations.'));
168+
end
172169

173170
end

0 commit comments

Comments
 (0)