why polybuffer example doesn't work ?
显示 更早的评论
I'm trying to use the function polybuffer for 2-D points or lines as in example:
P = [0 0; 1 1; 2 1];
polyout = polybuffer(P,'points',0.25)
plot(P(:,1),P(:,2),'r.','MarkerSize',10)
hold on
plot(polyout)
axis equal
or
P = [0 0; 1 1; 2 1];
polyout1 = polybuffer(P,'lines',0.25);
plot(P(:,1),P(:,2),'r.','MarkerSize',10)
hold on
plot(polyout1)
axis equal
hold off
but keep getting the following error:
Undefined function 'polybuffer' for input arguments of type 'double'.
Though the function works fine when using the following example:
polyin = polyshape({[0 0 1 3],[0.5 1.5 1.5 0.5]},{[0 3 3 0],[0.5 0.5 1.5 1.5]});
plot(polyin)
polyout1 = polybuffer(polyin,0.1);
hold on
plot(polyout1)
hold off
does anyone have an idea what did i do wrong ?
Thank you so much
3 个评论
John D'Errico
2018-4-17
编辑:John D'Errico
2018-4-17
When something does not work because it is not found, the very first question you should ask of yourself is what version of MATLAB you have. polyshape is fairly new as I recall.
If you are using an old release of MATLAb, you could/should look to see if that function was not created until after your release was issued. If not, then what can you expect?
If you have a current release, you might look to see if that code is in a specific toolbox you don't have. But polyshape is in MATLAB proper, at least if you have a current release.
So show the results from the ver command.
Guillaume
2018-4-17
polyshape requires R2017b or later, but polybuffer is even newer and requires the latest version: R2018a.
Faez Alkadi
2018-4-17
编辑:Faez Alkadi
2018-4-17
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Sparse Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!