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

Home » Public Forums » archive » Best fit line for sinusoid
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Best fit line for sinusoid [message #92010] Wed, 30 September 2015 07:22 Go to previous message
liam.steele is currently offline  liam.steele
Messages: 13
Registered: September 2015
Junior Member
Hi all,

I was wondering if there was a 'simple' way to get IDL to plot a best fit line for a sinusoidally-varying data set. For example, say temperatures were recorded each hour for 5 days at a certain location, with each measurement having an error of 2 deg C. Then we would have something like:

day = findgen(121)/24
temp = 15 + 10*sin(10*!pi*findgen(121)/120) + 5*randomu(seed, 121)
error = fltarr(121)+2

Is it possible from these three arrays for IDL to work out and plot a best fit line? I have searched online, and can't really find what I'm looking for. (surprisingly I have never had to plot a best fit line to anything before!)

Cheers,

Liam
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Job Posting: Computer Research Specialist / Research Software Engineer / University of Florida
Next Topic: join

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

Current Time: Wed Oct 08 09:19:06 PDT 2025

Total time taken to generate the page: 0.00423 seconds