I want to achieve what is in the comment of the code but using my code the for loop does not effect the result. How can I produce the matrix with the provided equation?
% 5x5 matrix, with elements given by A(i,j)= 1/(2^i+ 3^j). Print entire
% matrix, first row and second column. Two ways of displaying A(3,2)
clcclose allA = magic(i : j)for i = 1 : 5 for j = 1 : 5 A(i,j) = 1./(2^i+3^j); endendfprintf('A(i, j)\n');fprintf('%5.1f \t %5.1f \t %5.1f \t %5.1f \t %5.1f\n', [magic(i:j)])result:A(i, j) 17.0 23.0 4.0 10.0 11.0 24.0 5.0 6.0 12.0 18.0 1.0 7.0 13.0 19.0 25.0 8.0 14.0 20.0 21.0 2.0 15.0 16.0 22.0 3.0 9.0
Best Answer