X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 28 Apr 2007 10:20 PM by  anon
ARRAY QUESTION
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
28 Apr 2007 10:20 PM
    Hi, i have the following problem: A = [x1,x2,x3,...,xN] and from A I want to construct the following square matrix: |x1,x2, ..., xN| B=... |x1,x2, ..., xN| So ever of the N lines should contain the vector A. How can I do this with IDL? Thanks a lot!

    Deleted User



    New Member


    Posts:
    New Member


    --
    28 Apr 2007 10:20 PM
    This problem is solved surprisingly with a basic matrix math equation. If A = [x1,x2,x3,...,xN] then A # [1, 1, 1, ..., 1] will equal: [ [x1,x2,x3,...,xN], [x1,x2,x3,...,xN], [x1,x2,x3,...,xN], ..., [x1,x2,x3,...,xN] ] The IDL statement that performs this is: B = A # transpose(fltarr(N) + 1) ... assuming that A is a single-precision floating point datatype. James Jones
    You are not authorized to post a reply.