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 #82886 is a reply to message #42151] Mon, 21 January 2013 07:20 Go to previous messageGo to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
> I want to create an N by 4 (Nx4)matrix and an N by 1 (Nx1)matrix with my own elements. Does anyone know how to do it?

Helder's first example is good, but also, look into

Look into the lonarr(), intarr(), fltarr(), dblarr(), etc. functions in addition to make_array(). If you want a floating point array

N = 10
myNbyFour = fltarr(N, 4)
myNbyOne = fltarr(N, 1)

Then you can assign values to each element like

myNbyFour[0,0] = 5

or

myNbyFour [:,0] = [1, 2, 3, 4]

etc
[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: Fri Oct 10 16:30:07 PDT 2025

Total time taken to generate the page: 0.71645 seconds