if true
clear all;
close all;
r_1 = 5;
r_2 = 3;
r_3 = 2;
r_4 = 2;
center_1 = [2 2];
center_2 = [2 -2];
center_3 = [5 5];
center_4 = [-3 5];
alpha = 0:(2*pi)/120:2*pi;
circle_1 = [center_1(1)+r_1*sin(alpha)' center_1(2)+r_1*cos(alpha)'];
circle_2 = [center_2(1)+r_2*sin(alpha)' center_2(2)+r_2*cos(alpha)'];
circle_3 = [center_3(1)+r_3*sin(alpha)' center_3(2)+r_3*cos(alpha)'];
circle_4 = [center_4(1)+r_4*sin(alpha)' center_4(2)+r_4*cos(alpha)'];
shape = [circle_1
circle_2
circle_3
circle_4];
k = boundary(shape(:,2), shape(:,1), 1);
figure(1)
plot(circle_1(:,1), circle_1(:,2), 'r')
hold on;
grid on;
plot(circle_2(:,1), circle_2(:,2), 'b')
plot(circle_3(:,1), circle_3(:,2), 'g')
plot(circle_4(:,1), circle_4(:,2), 'm')
plot(shape(k,1), shape(k,2), 'k')
axis([-10 10 -10 10])
end
3 Comments
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/314918-boundary-function-fails-r2016b#comment_410564
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/314918-boundary-function-fails-r2016b#comment_410564
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/314918-boundary-function-fails-r2016b#comment_410739
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/314918-boundary-function-fails-r2016b#comment_410739
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/314918-boundary-function-fails-r2016b#comment_410796
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/314918-boundary-function-fails-r2016b#comment_410796
Sign in to comment.