n = 5; % No. of control points
array = 1:1:n;p=arrayfun(@(k) num2cell(nchoosek(array,k),2), 3:length(array), 'unif', 0);p=cat(1,p{:});p=cellfun(@(array) num2cell(perms(array),2),p,'unif',0);p=cat(1,p{:});x = [1 ; 2 ; 3 ; 4 ; 2 ]; % coordinate of control points
y = [8 ; 5 ; 8 ; 7 ; 6 ]; % coordinate of control pointsfor i = 1:length(p) x_p{i,1} = x(p{i,1}); y_p{i,1} = y(p{i,1}); end
From the above code, I got two cells x_p & y_p which provides coordinates of all possible polygons. I want to find the array of areas of all polygons. The size of area array will be (300 * 1). Thanks in advance.
Best Answer