bufferm 関数を使用せずに、matlab で指定された単純な多角形 (凸部なし、穴なし) のバッファー ゾーンを作成したいと思います。
vx = [ 2 4 6 4 2]; % polygon vertices
vy = [ 2 4 3 2 2];
figure;
% axis equal;
plot([vx vx(1)],[vy vy(1)],'r');
hold on;
vx = vx(end:-1:1); % Vertices in cw direction
vy = vy(end:-1:1);
xctr = mean(vx(1:end-1)); % find centroid of polygon
yctr = mean(vy(1:end-1));
sf = 2; % scale factor to extend polygon
rx = vx - xctr; % find radius
ry = vy - yctr;
angle = atand(ry/rx); % find angle
new_vx = xctr + rx * cosd(angle) * sf; % find new vertex at a distance of sf
new_vy = yctr + ry * sind(angle) * sf;
plot([new_vx new_vx(1)],[new_vy new_vy(1)], 'g');
しかし、それは間違ってプロットします。どんなアイデアでも..