mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 22:43:11 +02:00
19 lines
784 B
Mathematica
19 lines
784 B
Mathematica
|
|
function task4Plot(maxMatrixSize)
|
||
|
|
iterationsNoShiftsVector = zeros(maxMatrixSize);
|
||
|
|
iterationsShiftsVector = zeros(maxMatrixSize);
|
||
|
|
for i = 1 : maxMatrixSize
|
||
|
|
[~, iterationsNoShifts, ~, ~, iterationsShifts, ~] = task4(matrix4(i));
|
||
|
|
iterationsNoShiftsVector(i) = iterationsNoShifts;
|
||
|
|
iterationsShiftsVector(i) = iterationsShifts;
|
||
|
|
end
|
||
|
|
nexttile
|
||
|
|
plot(iterationsNoShiftsVector, '.');
|
||
|
|
title('Number of iterations for different sizes of matrices for no shift method');
|
||
|
|
xlabel('Size of matrix A');
|
||
|
|
ylabel('Number of iterations');
|
||
|
|
nexttile
|
||
|
|
plot(iterationsShiftsVector, '.');
|
||
|
|
title('Number of iterations for different sizes of matrices for shift method');
|
||
|
|
xlabel('Size of matrix A');
|
||
|
|
ylabel('Number of iterations');
|
||
|
|
end
|