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 #90443 is a reply to message #90427] Mon, 02 March 2015 23:26 Go to previous messageGo to previous message
Moritz Fischer is currently offline  Moritz Fischer
Messages: 32
Registered: June 2013
Member
Am 02.03.2015 um 18:12 schrieb g.nacarts@gmail.com:
> Yes, I saw your last message but I am interested to understand how you end up before with the a = reform(a, 100l, 200l*2l, /overwrite).

Ok, let's try again.

What does reform do?
It changes the arrangement of the array elements. Not its total number.
In your initial example you had an array of 200 by 200 elements (40,000
in total), and you *can* reaarrange the elements of such an array to an
100 by 400 element array (also 40,000 in total), that is why I gave that
example.
Helder picked the same example by chance, I might as well have suggested
to reform it to 64 by 625 elements (also 40,000 in total).
Or to 100 by 16 by 25 elements.

> Then I tried to write it like this:
> a = reform(a, 120l, 216l*2l, /overwrite)
> but I got the error that I mentioned before.

Check the total element number: 120 by 216*2 = 120 by 432 = 51840
Your initial array randumu(s,216,216) has 216 by 216 = 46656 elements.

You say you want to go from 216x216 to 100x216x216.
You cannot do this with reform.

But of course you can do it differently. That would depend on what you
want to look the new array like. (Copies of the original, different data
of the same size, you name it. But do name it.)
[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 13:55:20 PDT 2025

Total time taken to generate the page: 0.24043 seconds