help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A new version of bicubic in Octave


From: Hoxide Ma
Subject: Re: A new version of bicubic in Octave
Date: Mon, 5 Sep 2005 21:48:51 +0800 (CST)

I think this is version can be commit into the
octave-forge.

Thanks Paul Kienzle and David Bateman.

--- Hoxide Ma <address@hidden>写道:

> Thank you for you to notice me this bug.
> it's not only a mistake in typeing. It's a big
> mistake, 
> I have read the interp2.m especially the part of
> 'linear', then fixed the bug in bicubic.m .
> 
> now follow codes work well:
> 
>    A=[13,-1,12;5,4,3;1,6,2];
>    x=[0,1,4]+10; y=[-10,-9,-8];
>    xi=linspace(min(x),max(x),17);
>    yi=linspace(min(y),max(y),26);
>    mesh(xi,yi,bicubic(x,y,A,xi,yi));
>    [x,y] = meshgrid(x,y);
>    __gnuplot_raw__ ("set nohidden3d;\n")
>    hold on; plot3(x(:),y(:),A(:),"b*"); hold off;
> 
> 
> but :
>    ...
>    mesh(xi,yi,interp2(x,y,A,xi,yi,'cubic'));
>    ... 
> 
> have a problem.
> 
> you see the end of yi value is be eated :$
> 
> I will try to fix this problem. 
> In fact, the reason is that Y is negative, then Y *
> (1+eps) < Y, it's an expection. In my bicubic code ,
> i
> fixed this bug by move all points into positive
> part.
> 
> 
> I attach the new version of bicubic.m
> 
> 
> --- Paul Kienzle <address@hidden>写道:
> 
> > Fixed bug in line:
> > 
> >     t = 1 + (YI-Y(1))./((Y(rz)-Y(1))/(rz-1));
> > 
> > One of the Y was an X.
> > 
> > 
> > Doesn't work for X non-uniform.  E.g.:
> > 
> >   A=[13,-1,12;5,4,3;1,6,2];
> >   x=[0,1,4]+10; y=[-10,-9,-8];
> >   xi=linspace(min(x),max(x),17);
> >   yi=linspace(min(y),max(y),26);
> >   mesh(xi,yi,interp2(x,y,A,xi,yi,'cubic'));
> >   [x,y] = meshgrid(x,y);
> >   __gnuplot_raw__ ("set nohidden3d;\n")
> >   hold on; plot3(x(:),y(:),A(:),"b*"); hold off;
> > 
> > - Paul
> > 
> > 
> > On Aug 28, 2005, at 9:43 AM, Hoxide Ma wrote:
> > 
> > > It's really a new version , not based on any
> > commerce
> > > codes.
> > >
> > > It's based on my note:
> > >
> > >
> http://wiki.woodpecker.org.cn/moin/Octave/Bicubic?
> > 
> > > action=AttachFile&do=get&target=bicubic.pdf
> > >
> > > You can test my code by run intt1.m and intt2.m
> .
> > >
> > > intt2.m is a example to interpolation  by a
> > > anomalistic surface.
> > >
> > > BTW: I'm sorry for my poor English :P
> > >
> > >
> >
>
==========================================================
> > >
> > > A student of Math in Soochow University in
> China.
> > > Intrested in Math, Python, Octave, Lisp, Maxima,
> > Prolog and .NET/MONO.
> > >
> > > Blog: http://blog.sina.com.cn/blog/1142604745
> > > Wiki: http://wiki.woodpecker.org.cn/moin/Hoxide
> > >
> > >
> > >   
> > >
> > >   
> > >           
> > >
> >
>
___________________________________________________________
> > > 雅虎免费G邮箱-中国第一绝无垃圾邮件骚扰超大邮箱
> > > http://cn.mail.yahoo.com
> > > <interp2.m><intt1.m><intt2.m><bicubic.m>
> > 
> > 
> 
>
==========================================================
> 
> A student of Math in Soochow University in China.
> Intrested in Math, Python, Octave, Lisp, Maxima,
> Prolog and .NET/MONO.
> 
> Blog: http://blog.sina.com.cn/blog/1142604745
> Wiki: http://wiki.woodpecker.org.cn/moin/Hoxide
> 
> 
>               
>
___________________________________________________________
> 
> 雅虎免费G邮箱-No.1的防毒防垃圾超大邮箱 
> http://cn.mail.yahoo.com

==========================================================

A student of Math in Soochow University in China.
Intrested in Math, Python, Octave, Lisp, Maxima, Prolog and .NET/MONO.

Blog: http://blog.sina.com.cn/blog/1142604745
Wiki: http://wiki.woodpecker.org.cn/moin/Hoxide


        

        
                
___________________________________________________________ 
雅虎免费G邮箱-中国第一绝无垃圾邮件骚扰超大邮箱 
http://cn.mail.yahoo.com

Attachment: interp2.m
Description: 1501818151-interp2.m

Attachment: bicubic.m
Description: 1097144256-bicubic.m


reply via email to

[Prev in Thread] Current Thread [Next in Thread]