swswkr123 发表于 2006-6-11 14:58

请求高手看下哪错了怎么改

有人会改这个程序不~!<BR>&gt;&gt; function =calculate_distance(b,X,Y)<BR>% Calculate distance between bezier curve and a point<BR>%=calculate_distance(b,X,Y)<BR>if ~strcmpi(class(b),'bezier')<BR>error('Expecting a bezier object');<BR>end<BR>=deal(b.x0,b.ax,b.bx,b.cx,b.y0,b.ay,b.by,b.cy);<BR>jj=;<BR>dj=polyder(jj);<BR>r=roots(dj);<BR>i=find(imag(r)==0 &amp; r&gt;=0 &amp; r&lt;=1);<BR>pt=;<BR>if ~isempty(i)<BR>pt=;<BR>end<BR>v=polyval(jj,pt);<BR>=min(v);<BR>t=pt(i);<BR>xp=polyval(,t);<BR>yp=polyval(,t);<BR>d=norm(-);<BR><BR>??? function =calculate_distance(b,X,Y)<BR>    |<BR>Error: Function definitions are not permitted at the prompt or in scripts.<BR>后边两行提示的错误~<BR>

swswkr123 发表于 2006-6-11 15:00

还有这个~

<P>&gt;&gt; % bezier_demo<BR>disp('Enter 4 points to define a Bezier curve and than edit it in WYSYWIG.');<BR>disp('You can move both end points and control points. Close the window when you are ready.');<BR>p=ginput(4);<BR>c=num2cell(p(:)');<BR>delete(gcf);<BR>=deal(c{:});<BR>b=bezier('xpoints',);<BR>c=edit_curve(b)<BR>hold on<BR>disp('Now variable c contains a Bezier object.');<BR>Enter 4 points to define a Bezier curve and than edit it in WYSYWIG.<BR>You can move both end points and control points. Close the window when you are ready.</P>
<P>??? Undefined command/function 'bezier'.<BR></P>

suffer 发表于 2006-6-11 19:53

回复:(swswkr123)请求高手看下哪错了怎么改

你都没有定义bezier这个函数

ericlin 发表于 2006-6-12 12:05

你的东西是个子程序吧,先建立m文件才能在命令窗口运行吧
页: [1]
查看完整版本: 请求高手看下哪错了怎么改