Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using MATLAB 17. As shown in the figure, the area of a convex polygon can be calculated by adding the area of the triangles that

Using MATLAB image text in transcribed
17. As shown in the figure, the area of a convex polygon can be calculated by adding the area of the triangles that the polygon can be divided into. Write a user- G defined MATLAB function that calculates the area of a convex n-sided polygon. For the function name H and arguments, use A = APolygon (Crd), The input argument Crd is a two-column matrix where each row contains the coordinates of a vertex (first column is the x coordi- nate and the second column is the y coordinate). The vertices are listed in the order that they are connected to form the polygon (i.e, coordinates cf point A in the first row, point B in the second, and so on). The output argu- ment A is the area of the polygon. Write the code of APolygon such that it has a subfunction that calculates the area of a triangle for given vertices coordinates. Use APolygon to calculate the area of the polygon shown in the figure. The coordinates of the vertices are: A(1, 1), B(7, 2), C(10, 5), D(9

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

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

What is the difference between upper and lower CASE tools?

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago