I'm trying to change all the numbers in a matrix between 1: n^2
My code is:
function output = IsMagic(n)A= zeros(n);r=1;c=1;row_index = 0;while row_index <= r col_index=0; while col_index <= c A(r,c) = randi(1*n^2); col_index=col_index + 1; end row_index= row_index +1;endoutput=A;end
Best Answer