how can i calculate a complex polygon with coordinates in matlab ?
Show older comments
Hi,
how can I calculate A complex polygon in Matlab?
image shows what I need to calculate in Matlab. do you guys have any code for that ? or are there any Matlab command which can calculate it by coordinates?
thanks in advance

4 Comments
Steve Eddins
on 19 Oct 2020
What do you mean by "calculate it"? Do you mean calculate its area? Or something else?
Rik
on 19 Oct 2020
Or do you want to draw a polygon like this?
ADNAN KIRAL
on 19 Oct 2020
ADNAN KIRAL
on 19 Oct 2020
Accepted Answer
More Answers (2)
Durganshu
on 19 Oct 2020
0 votes
You can use polyarea for accomplishing your task. The documentation is here:
Hope that helps!
1 Comment
ADNAN KIRAL
on 19 Oct 2020
Steven Lord
on 19 Oct 2020
If you want to do more than just compute its area I would use polyshape for that.
>> x = [7 7 5 3 -5 0 -8 2 -4];
>> y = [-7 3 -6 3 3 8 3 -3 -8];
>> P = polyshape(x, y);
>> plot(P)
There are a number of questions you can ask about a polyshape and a number of operations you can perform on one.
1 Comment
ADNAN KIRAL
on 19 Oct 2020
Categories
Find more on Polygonal Shapes in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
