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

Home » Public Forums » archive » how to compile a matrix whose some elements are matrixes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
how to compile a matrix whose some elements are matrixes [message #49308] Fri, 14 July 2006 00:11 Go to previous message
haojuanchina@gmail.co is currently offline  haojuanchina@gmail.co
Messages: 3
Registered: July 2006
Junior Member
Hello,everyone
I want obtain a matric whose some elements are matrixes, how to compile

the program?
example: I want to abtain the following matrix
G I 0 0 0 0 0
I G I 0 0 0 0
0 I G I 0 0 0
0 0 I G I 0 0
0 0 0 I G I 0
0 0 0 0 I G I
0 0 0 0 0 I G
in which I is an identity matrix,
1 0 0 0 0 0 0
0 1 0 0 0 0 0
0 0 1 0 0 0 0
0 0 0 1 0 0 0
0 0 0 0 1 0 0
0 0 0 0 0 1 0
0 0 0 0 0 0 1
and G is a similar diagonal matrix:
1 2 0 0 0 0 0
2 1 2 0 0 0 0
0 2 1 2 0 0 0
0 0 2 1 2 0 0
0 0 0 2 1 2 0
0 0 0 0 2 1 2
0 0 0 0 0 2 1
I can compile the program of the matrix G and I:
PRO Matrix

diag =findgen(7)
sub=findgen(6)
super=findgen(6)


diag[0:6]=1
sub[0:5]=2
super[0:5]=2


G = DIAG_MATRIX(diag) + $
DIAG_MATRIX(super, 1) + DIAG_MATRIX(sub, -1)
G[0,1:5]=2
G[1:5,0]=2
print,G

I= identity(7)
print,I

END


but how to get the first matrix in which include the matrix G and I?
The difficulty is that I can not compile the diagonal elements (the
smaller matrixes) of the larger matrix. How should I do?
Thanks!
Juan Hao
[Message index]
 
Read Message
Read Message
Previous Topic: Re: IDL and Macs. Speed is not only about squared roots
Next Topic: IDL and Macs. Speed is not only about squared roots

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

Current Time: Fri Oct 10 14:16:33 PDT 2025

Total time taken to generate the page: 0.31878 seconds