Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

ISBN: 1680833243, 978-1680833249

More Books

Students also viewed these Databases questions