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

Home » Public Forums » archive » Re: Absurd Indexes
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: Absurd Indexes [message #9385 is a reply to message #9376] Tue, 17 June 1997 00:00 Go to previous messageGo to previous message
Hans Luh is currently offline  Hans Luh
Messages: 1
Registered: June 1997
Junior Member
Inigo Garcia wrote in article <33A6A7D5.777F@astro.rug.nl>...
> Hi !
>
> I have a problem with some "sticky dimension in a matrix. The thing is
> that if you make something like:
>
> a=findgen(4,1000)
> b=fltarr(2,*)
>
> the array I get is an [1,1000] array, and I want an [1000] array !!!
> Does someone know any way of getting rid off that "1" dimension.
> (OK, I know the "for" loop method, but, there's no other method to do it
> ?)

I am not sure that I understand your problem correctly. However, I try

a=findgen(4,1000)

b=fltarr(2,*)



on the PV-WAVE and get

WAVE> a=findgen(4,1000)
WAVE> b=fltarr(2,*)

b=fltarr(2,*)
^
% Syntax error.


Obviously, 'b=fltarr(2,*)' is wrong. If we use size() to check the
dimensionality of a, we can find that a is a two dimensional array.

WAVE> print,size(a)
2 4 1000 4 4000

OK. If you want an one dimensional array, just use

WAVE> a=findgen(1000)
WAVE> print,size(a)
1 1000 4 1000

You now have an [1000] array.

Hans.
[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 UNIX->PC code compatability
Next Topic: Smooth scrolling zoom in draw widget; how?

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

Current Time: Wed Oct 08 19:11:35 PDT 2025

Total time taken to generate the page: 0.00521 seconds