Contents

create simple input data

mat1 = ones(1000, 2);
mat2 = ones(2, 1000);
mat3 = ones(1000, 2);
mat4 = ones(2,10000);
mat5 = ones(10000,10000);

start measuring

tic;
for i = 1:10

MathUnit algorithm

    for j= 1:4
        h1 = mat1 * mat2;
        h2 = mat3 * mat4;
        h3 = h1 * h2;
        matOut = h3 * mat5;
    end

finish measuring

end
toc;%divide result by 10 if 10er for loop is used