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

Home » Public Forums » archive » Column vector matrix creation from PC image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Column vector matrix creation from PC image [message #76703] Wed, 22 June 2011 04:05
Lavanya is currently offline  Lavanya
Messages: 7
Registered: August 2010
Junior Member
Hi,

I am trying to create a column vector of the form

E = [[ 1, 1, 1, ......1], [e1,e2, .... ep], ......[e1(n),
e2(n)....ep(n)]]

where the first row values are one, p user input values. Now i need to
fill the matrix with random values that are obtained from an PC
image.

Here is the code for reference:

covMatrix = Correlate(image11, /COVARIANCE, /DOUBLE)
eigenvalues = EIGENQL(covMatrix, EIGENVECTORS=eigenvectors, /DOUBLE)
Print, eigenvalues
Print, 'First Component (%): ', eigenvalues[0]/Total(eigenvalues)*100

for i=0, bands-1 do begin;
pc = eigenvectors ## Transpose(image11)
pc1[*,*,i] = Reform(pc[*,i], rows, cols)
; pc1[*,*,i] = Reform(temporary(pc[*,i]), dims[0], dims[1],4)
endfor

p = 30

TestMatrix = fltarr(p,p)
TestMatrix(*,0) = 1
idx1 = fltarr(1,p)
;data = pc(*,p-1)

for i=0,p-1 do begin
seed = 100L
idx = floor(randomu(seed,p)) + 1
TestMatrix(1:p,*) = pc(idx,*) ; error at
this place
idx1(i) = idx;
endfor

Finally, i need to construct TestMatrix
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Formatted printf output
Next Topic: Sort a HASH

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

Current Time: Wed Oct 08 17:05:10 PDT 2025

Total time taken to generate the page: 0.00549 seconds