comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: strange behaviour of ladfit - known?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: strange behaviour of ladfit - known? [message #52884] Thu, 08 March 2007 07:26
Ingo von Borstel is currently offline  Ingo von Borstel
Messages: 54
Registered: September 2006
Member
Hi,
>> ###############################
>> ; create an array and initilize it
>> x = dblarr(100)
>> for i=0,99 do x[i] = sin(2*!pi/15*i)
>>
>> ;get a short subarray and create another scaled version of it.
>> Important: without offset
>> xcut = x[20:30]
>> y = xcut * 1.6
>>
>> ; calculate the linear relation between xcut and y - or rather try it.
>> print, ladfit(xcut,y)
>> ###############################
>
> I'm using IDL 6.1 on sparc sunos and your code works fine:

Hmm...

> BTW - how about using:
> x = sin(2*!pi/15*dindgen(100))
Sounds like a plan. Thanks for pointing out. I have many applications
where to do this instead of nasty loops.

Best regards,
Ingo


--
Ingo von Borstel <newsgroups@planetmaker.de>
Public Key: http://www.planetmaker.de/ingo.asc

If you need an urgent reply, replace newsgroups by vgap.
Re: strange behaviour of ladfit - known? [message #52888 is a reply to message #52884] Thu, 08 March 2007 06:45 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Mar 8, 3:29 am, Ingo von Borstel <newsgro...@planetmaker.de> wrote:
> Hi there,
>
> I just encountered a strange behaviour of ladfit - it just won't return
> to the command prompt when I do the following:
>
> ###############################
> ; create an array and initilize it
> x = dblarr(100)
> for i=0,99 do x[i] = sin(2*!pi/15*i)
>
> ;get a short subarray and create another scaled version of it.
> Important: without offset
> xcut = x[20:30]
> y = xcut * 1.6
>
> ; calculate the linear relation between xcut and y - or rather try it.
> print, ladfit(xcut,y)
> ###############################
>
> It works nicely as soon as I add an offset to y or if I use different
> data, though I can reproduce it with any subset of x. Is there a way to
> circumvent this behaviour or test prior to its occurence for it, if I
> don't know my input data prior to the start of a programme? I'm using
> IDL 6.1.
> Or does anyone know whether this behaviour can be reproduced with a
> newer version of IDL?
>
> Best regards,
> Ingo
>
> --
> Ingo von Borstel <newsgro...@planetmaker.de>
> Public Key:http://www.planetmaker.de/ingo.asc
>
> If you need an urgent reply, replace newsgroups by vgap.

I'm using IDL 6.1 on sparc sunos and your code works fine:

IDL> print, ladfit(xcut,y)
% Compiled module: LADFIT.
0.00000000 1.60000000

BTW - how about using:
x = sin(2*!pi/15*dindgen(100))
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Structure compare
Next Topic: Re: What is the difference between 'curvefit', 'lmfit' and 'svdfit' procudure?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 17:43:36 PDT 2025

Total time taken to generate the page: 1.28126 seconds