%rows %columns: 'Problem 9.a/n' 'Enter The Number of A Row' 'Enter The Number of A Column'
%rows %columns: 'Problem 9.a/n' 'Enter The Number of A Row' 'Enter The Number of A Column'
a\n');
for i = 1:A
for j = 1:B
M(i,j) = i*j;
end;
end;
disp(M); %return M
fprintf('Problem 9.b\n');
for i = 1:A
for j = 1:B
M(i,j) = i*j;
end;
end;
disp(M); %return M
fprintf('Problem 9.c\n');
for i = 1:A
for j = 1:B
M(i,j) = i*j;
end;
end;
disp(M);
fprintf('Problem 10\n');
goal = 40000;
s = 0;
i = 1;
while 1
s = 2*7*i;
if s^2 > goal
break
end
i = i+1;
end
disp(s);
fprintf('Problem 11\n');
A = [9.00 4.00 2.00;7.00 5.00 3.00;6.00 8.00 9.00];
B = [5.00 4.00 3.00;7.00 6.00 8.00;9.00 2.00 9.00];
a = 3;
b = 3;
C = zeros(a,b);
for i = 1:a
for j = 1:b
if A(i,j)== B(i,j)
C(i,j) = A(i,j);
else
C(i,j) = 0;
end;
end;
end;
disp(C);