test file
DESCRIPTION
fileTRANSCRIPT
![Page 1: test file](https://reader036.vdocuments.site/reader036/viewer/2022071707/55cf850e5503465d4a8b48f2/html5/thumbnails/1.jpg)
function [P] = polyprop(test) %This is primary functionx = test(:,1)y = test(:,2)polygon.numsides = length(test)polygon.area = area(test)polygon.perimeter = perimeter(test)polygon.centroid = centroid(p)polygonend %polyprop function per = perimeter(test) for i = 1:length(test); tot = 0; % Y = 1:length(y); tot = tot + sqrt((x(i)-x(i+1)).^2 + (sqrt(y(i)-y(i+1)).^2)) per = totend endfunction[A] = polyarea(x)a=0;alpha = length(x) - 1;for i = 1:alpha; a = a + abs((x(i,1).*x(i+1,2) - x(i+1,1).*x(i,2)));end [A] = .5.*a;end