Info
This question is closed. Reopen it to edit or answer.
Compute the area of points with coordinates form two matrices
1 view (last 30 days)
Show older comments
I'm generating two matrices, where the entries of theta_init represent the x-, and the entries of theta_dot_init represent the y-coordinates of the points. Now I want to compute the area spanned by the outer points. b = boundary(theta_init,theta_dot_init) returns an error.
m = 10; % number of points in ensemble
r = 2; % radius around inital starting point
theta_0 = 1;
theta_dot_0 = 0;
theta_init = zeros(m,m);
theta_dot_init = zeros(m,m);
% Generate inital points
for k=1:m
theta_1 = transpose(linspace(theta_0-r,theta_0+r,m));
theta_dot_1 = linspace(theta_dot_0-r,theta_dot_0+r,m);
theta_init(:,k) = [theta_1];
theta_dot_init(k,:) = [theta_dot_1];
end
plot(theta_init,theta_dot_init,'k.')
% b = boundary(theta_init,theta_dot_init)
0 Comments
Answers (1)
David Hill
on 23 Nov 2020
Did you look at the alphaShape() function?
a=alphaShape(theta_init(:),theta_dot_init(:));
b=a.area;
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!