fixed point iteration and plotting iteration
조회 수: 7 (최근 30일)
이전 댓글 표시
I have a map
such that
,
where
is closed unit disc in
and define
where ,
taking
,
, 
, i want a matlab code whch calculates
iteration for
in a table format and plots these iteration in
. i will be thankful if someone could help me with it.
댓글 수: 2
David Goodmanson
2023년 9월 18일
Hi Akansha, the statement x_n+1 = (1-lambda)x_n + lambda x_n appears to be incorrect since the outcome is the uninteresting x_n+1 = x_n. Also, how does T enter into it?
채택된 답변
Voss
2023년 9월 19일
T = @(xy)xy([2 1]).*[-1 1];
n_iterations = 20;
lambda = [0.1 0.2 0.3 0.4];
n_lambda = numel(lambda);
result = cell(1,n_lambda);
for jj = 1:n_lambda
xy = zeros(n_iterations,2);
xy(1,:) = [0.5 1];
for n = 1:n_iterations
xy(n+1,:) = (1-lambda(jj))*xy(n,:) + lambda(jj)*T(xy(n,:));
end
result{jj} = array2table(xy,'VariableNames',{'x','y'},'RowNames',compose('%d',(0:n_iterations).'));
end
figure
hold on
for jj = 1:n_lambda
plot(result{jj}.x,result{jj}.y)
end
legend("lambda = "+lambda,'Location','NorthWest')
result{:}
댓글 수: 3
Manahel
2025년 5월 8일
How can I save both the graph and the iteration result tables into a PDF file in MATLAB? Also, where can we find an explanation for each step in the code so we can understand it better
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
