n=1for aa=1:50 for bb=aa+1:50 for cc=bb+1:50 if cc^2==aa^2 + bb^2 a(n)=aa; b(n)=bb; c(n)=cc; n=n+1; end end endendpythagorean=[a', b', c']
MATLAB: How am i suppose to display the elements divisible to 5 from the Pythagorean theorem using numbers 1-50. every time i use the rem function i get a bunch of 0s and 1s. got this so far which only displays the Pythagorean theorem combinations from 1-5
pythagoreanrem function
Best Answer