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

Home » Public Forums » archive » REFORM: new subscripts must not change the number elements in array
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: REFORM: new subscripts must not change the number elements in array [message #90433 is a reply to message #90431] Mon, 02 March 2015 11:55 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
g.nacarts@gmail.com writes:

> I used the example provided by mo who said that 200*200=100*400. When a 2D array has dimensions [216,216] then 216*216=120*388.8
>
> when I tried a=reform(a,120l,388.8L,/overwrite) I got the old error

Are you familiar with "counting" numbers? 1,2,3,...

Array dimensions can only be specified with counting numbers. 388.8 is
real number, but not a counting number. You can pick any two counting
numbers to multiply together, so long as the TOTAL (also a counting
number) is the same counting number you get when you multiply the
original dimensions of the array together. Another way of saying this is
that when you reform (bend, shape, twist, etc.) an array, it can't end
up with more or less array elements then when you started.

If you DO want to end up with some other number of elements, then you
are going to have to REBIN your array, rather than REFORM it.

I say this in the most gentle way possible, but are you sure you are on
the right career path? I'm not sure math (and by extension computer
programming) is really going to be your thing. There is a way of
thinking and seeing the world that is required to write computer
programs that some people (no fault of their own!) just don't have. You
might be happier and less frustrated doing something that is more
closely related to your nature.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: function graphics event handling
Next Topic: Image in color scale and gray level scale.

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

Current Time: Wed Oct 08 11:32:55 PDT 2025

Total time taken to generate the page: 0.00468 seconds