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

Home » Public Forums » archive » Re: findgen([variable])
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: findgen([variable]) [message #22894 is a reply to message #22893] Tue, 12 December 2000 10:52 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
JD Smith <jdsmith@astro.cornell.edu> writes:

> Craig Markwardt wrote:
>>
>> Martin Skou Andersen <skou@fys.ku.dk> writes:
>>> Is it posible to make an mutiple dimensional array by using a variable
>>> such as findgen(x)?
>>
>> This is virtually impossible, right? You are asking for each row of
>> the resulting array to be of a different length. That's not really a
>> 2 dimensional array is it?
>
>
> Are we sure he doesn't just mean:
>
> findgen(x[0],x[1]) ?

Ah yes, that would be a good idea. In fact, one of my "top ten"
requests was to have all of the functions that accept dimensions,
accept them in a consistent way. REBIN, REFORM and TOTAL are all
different. We should be able to specify dimensions consistently
between them, and either as an array, or a list of scalars.

Here is my entry. Sorry, no HISTOGRAM call, but I need to give it a
rest once in a while.

nel = dims(0)
for i = 1L, n_elements(dims)-1 do nel = nel * dims(i)
arr = reform(findgen(nel), dims)

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL and external app in concurrent mode
Next Topic: Background colors in PNG files?

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

Current Time: Fri Dec 05 03:36:22 PST 2025

Total time taken to generate the page: 0.40155 seconds