Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using MATLAB 3. Write a function M-file called triangles that: takes as input 3 sides (say a, b and c) of a triangle; yields the
Using MATLAB
3. Write a function M-file called triangles that: takes as input 3 sides (say a, b and c) of a triangle; yields the perimeter, say p, and area, say A (using Heron's formula given below) of the triangle as output. Perimeter: p a+ b+C; Heron's formula for Area: A- sqrt(s(s-a)(s-b)(s-c)), where s p/2, the semi-perimeter Cont.' on next page Use the command window to check that your code works for a 3-4-5 right triangle and a 5-12-13 right triangle. (Use A /2 bh in your check for the area.) Note that the check does not have to be part of the function M-file
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started