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

Home » Public Forums » archive » matrices with different size
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: Matrices [message #82878 is a reply to message #42151] Mon, 21 January 2013 12:06 Go to previous messageGo to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On 1/21/13 11:39 AM, fd_luni@mail.com wrote:
> Τη Δευτέρα, 21 Ιανουαρίου 2013 5:21:13 μ.μ. UTC+2, ο χρήστης Matthew Argall έγραψε:
>>> myNbyFour [:,0] = [1, 2, 3, 4]
>>
>>
>>
>> Sorry, this should be
>>
>>
>>
>> myNbyFour[0,*] = [1, 2, 3, 4]
>
> Thank you very much for your answers. Maybe I didn't explain very well what I actually wanna do before. Let's say I have four arrays A,B,C,D and E with 100 elements each. Now, I want to create an array which includes the elements of A,B,C and D (100 by 4 matrix).In other words, I want to write the four arrays A,B,C,D into 1 matrix,and a matrix which includes only the elements of E (vertically) so 100 by 1 matrix.
>

IDL> ABCD = [[A], [B], [C], [D]]
IDL> help, ABCD
<Expression> FLOAT = Array[100, 4]
IDL> Ecolumn = reform(E, n_elements(E), 1)
IDL> help, Ecolumn
ECOLUMN FLOAT = Array[100, 1]

Of course, Ecolumn will lose the trailing single dimension if you do
anything with it... but many (but not all!) things you might think of
doing with it won't care.

-Jeremy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: LSODE status=-1
Next Topic: Imposing inverse fft to be real

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

Current Time: Sat Oct 11 00:42:14 PDT 2025

Total time taken to generate the page: 0.64567 seconds