The Pythagorean theorem states that for a right triangle, the relationship between the length of the hypotenuse c and the lengths of the other sides a and b is given by:
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:4| Question number:7.4
All Answers
total answers (1)
Ch4Ex7.m
c = input('Enter the length of c: ');
a = input('Enter the length of a: ');
if a > 0 && c > 0
b = findb(a,c);
fprintf('The length of b is %.1f\n', b)
else
fprintf('Error in input\n')
end
need an explanation for this answer? contact us directly to get an explanation for this answer