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

Home » Public Forums » archive » a matrix whose some elements are matrixes
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
a matrix whose some elements are matrixes [message #49282] Mon, 10 July 2006 01:19
haojuanchina@gmail.co is currently offline  haojuanchina@gmail.co
Messages: 3
Registered: July 2006
Junior Member
I want obtain a matric whose some elements are matrixes, how to compile
the program?
example: Iwant to abtain the following matrix
G I I I I I 0
I G I 0 0 0 0
I I G I 0 0 0
I 0 I G I 0 0
I 0 0 I G I 0
I 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 -0.25 -0.25 -0.25 -0.25 -0.25 0
-0.25 1 0 0 0 0 0
-0.25 0 1 0 0 0 0
-0.25 0 0 1 0 0 0
-0.25 0 0 0 1 0 0
-0.25 0 0 0 0 1 0
0 0 0 0 0 0 1
I can compile the program of the matrix G:
PRO Matrix

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

diag[0:6]=1
sub[0:5]=-0.25
super[0:5]=-0.25

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

I= DIAG_MATRIX(diag[0:6]);*(-0.25)
print,I

END

but how to get the first matrix in which include the matrix G and I ?
Please give me a help!thanks.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How can I display truecolor image on a map?
Next Topic: Re: a matrix whose some elements are matrixes

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

Current Time: Wed Oct 08 19:05:29 PDT 2025

Total time taken to generate the page: 0.00361 seconds