Matlab Apply the Pythagorean identity by computing hypotenuse lengths from known short side lengths, and display the results.
(i) Define individual values to the short side lengths, using variables named a and b. Compute the hypotenuse length, naming it c. Use the disp function to say "The short sides have lengths:", then display the variables. Then, use the disp statement to say "The hypotenuse has a length of", then display the computed variable.
(ii) Carry out the above, but instead of using a and b, use variables av and bv, and define 2460 16], respectively. Carry out the computation as before, but ensure that can be done in "vectorized" fashion. Modify the disp statements to express that you are displaying sets of shortest-side values, corresponding second-shortest side values, and the respective hypotenuse lengths.
(iii) Introduce a vector of test hypotenuse values - call it c_(-)test - defined as 12402564,16. Create a vector of logical values that will be 1 if the corresponding elements of vectors av and bv form pythagorean triples with the corresponding elements of c_(-)test.
Note: The output will appear somewhat crude. Later in the course, we will see how all the data can be displayed neatly.