the polyarea function gives the wrong area
Mostra commenti meno recenti
<<

>>
Hi, I have a question with the polyarea function
x = [0 3 3 0 0 1 1 2 2 1]; y = [0 0 3 3 0 1 2 2 1 1];
With this curve the value it gives is 8, which is correct
However I made a very similar curve

x = [0 0.4258 0.4258 0 0.009 0.4168 0.4168 0.009 0.009]; y = [0 0 0.1807 0.1807 0 0.009 0.009 0.1717 0.1717 0.009];
and the value it gives is polyarea (x, y) -> 0.1433. And the value that should give is 0.010593
someone knows why ?
3 Commenti
madhan ravi
il 30 Ott 2018
The later dimensions are not the same
KSSV
il 30 Ott 2018
YOu have not copied entire x. To use polyarea your order of the coordinates should follow a order..if not you will get wrong area. Give the entire x. In this case x is 1X9 and y is 1X10. So, we cannot apply polyarea.
Sergio arias fernandez
il 30 Ott 2018
Risposta accettata
Più risposte (1)
Sergio arias fernandez
il 30 Ott 2018
0 voti
Categorie
Scopri di più su Elementary Polygons in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

