among a,b,c., specify the hypotenuse.
that's the tricky part here ;) Check all combinations - too bad 'combvec' doesnt work here
Passes for True, but Failing when I get to false test?? Not sure at the moment what I could be missing.
Yes, I finally got it
The 2nd test is incorrect.
function flag = isRightAngled(a,b,c)
x=[a b c];
y=sort(x);
flag = y(1)^2+y(2)^2==y(3)^2;
end
flag = false;
A = (acos((b^2+c^2-a^2)/(2*b*c)))*180/pi;
B = (acos((a^2+c^2-b^2)/(2*a*c)))*180/pi;
C=180-A-B;
D=[A,B,C];
if any(D==90)
flag = true;
end
why is it correct? only because the test case.
a=100, b=20, c=5 will flag true but it not true
Without using str2num or regexp
Project Euler: Problem 5, Smallest multiple
402 Solvers
724 Solvers
Given a 4x4 matrix, swap the two middle columns
517 Solvers
234 Solvers
Find the sides of an isosceles triangle when given its area and height from its base to apex
450 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!