⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bezierall.m

📁 自己编写的matlab gui可以实现贝塞尔曲线的参数选择和拟合效果
💻 M
字号:
%Bezier general function
%plot in 51 points
function [base,all]=Bezierall(P,N)
                            %number of plotting points
pointsize=size(P);          %get the points decides the number of bases 4=5-1 and dimension;
length=pointsize(1);        %the group of control points 5
dimension=pointsize(2);     %the dimension of points 2D or 3D

n=length-1;
all=zeros(1,N,dimension);
base=zeros(length,N);
temp=zeros(length,N,dimension);
for k=0:n           %the number of bases
    for u=0:N-1     %draw N points
        base(k+1,u+1)=nchoosek(n,k).*(u/(N-1))^k.*(1-(u/(N-1)))^(n-k);
    end
    for u=0:N-1
        temp(k+1,u+1,:)=P(k+1,:).*base(k+1,u+1);
    end
    all(1,:,:)=all(1,:,:)+temp(k+1,:,:);
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -