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

Home » Public Forums » archive » Re: Beginner: Oplot line t^(-5/3)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Beginner: Oplot line t^(-5/3) [message #82032 is a reply to message #82028] Mon, 12 November 2012 08:37 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Charlie Paul D'auria writes:

> Please bear in mind that I am a complete IDL beginner so excuse any foolishness!
>
> I have managed to plot an XY graph with data plots.
>
> My problem lies with my next stage: I need to generate a line of gradient t^(-5/3) (then use oplot over my data).
>
> I get the error 'Attempt to subscript T with I is out of range.' and when I type print,line I only get one value for my line...
>
> Here is some code I was provided with as a guide, which I have modified slightly:
>
> line=dblarr(9999)
> n=1E-4
> t=dblarr(9999)
>
> for i=0,9999 do begin
> t(i)=i
> line=n*t(i)^(-5./3.)
> endfor
>
> I have used 9999 as 1E+5 was apparently too large, or something..

You need to find a better programming buddy. :-)

Try this, although I doubt this is what you really want:

line = (Dindgen(9999) + n)^(-5./3.)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: correlation of single pixels
Next Topic: envi_get_data

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

Current Time: Thu Oct 09 21:15:33 PDT 2025

Total time taken to generate the page: 0.31973 seconds