Need help creating a matrix with unknown amount of rows.

This code should call a separate function that counts and returns the number of triples found. As it finds legitimate triples, this function must call a subfunction that prints that triple to the screen. After this search function finishes its search it must return the number of 3-4-5 triangles that it found and the program script must print the number of triangles found. I found error in line 15. I'm trying to stoer each "3-4-5" triangle into a matrix, with one triangle in each row for example [3 4 5] would be the values for a b and hypotenuse.

 Accepted Answer

The error message is clear: The variable "c" is not defined. Maybe "hyp" is the wanted variable?
Please post code as text, because screen shots cannot be used by copy&paste to post a suggested solution.

More Answers (0)

Products

Asked:

on 25 Oct 2022

Answered:

Jan
on 25 Oct 2022

Community Treasure Hunt

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

Start Hunting!