%Solution to P6

disp ('P-6');

res=0;

A=magic(4);

for row=1:4

for col=1:4

if A(mod(A,4)==0)==0

res=mat;

end

end

end

disp(res);

This is my code.

2 views (last 30 days)

Show older comments

Noah Franks
on 22 Oct 2019

David Hill
on 22 Oct 2019

You need to explain more; because based on your description, the answer works perfectly.

Cre'Shawn Dabney
on 23 Oct 2019

Hey Noah this should be the code. Just incase you didnt get it yet.

disp('P-6');

res=0;

a=0;

for row=1:4

for col=1:4

if mat==mat

a=magic(4);

a(mod(a,4)==0)=0;

end

end

end

disp(a);

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!