## 105 Reputation

12 years, 121 days

## Multiplying Matrix...

Hi,

Question 1:
In matlab, i write "Ck=zeros(18,18,6)" which will give me the answer Ck(:,:,1), Ck(:,:,2), Ck(:,:,3)... Ck(:,:,6).
I tried writing Ck:=ZeroMatrix(18,18,6) but it doesn't work. May I know what is the right way to write it please?

Question 2:
Relating to the above question, I now have several Ck matrix, Ck1, Ck2, Ck3... Ck6. and also several P matrix, P1,P2,P3...P6. Each Ck and P matrix are 9x9matrices. How can I write A:=Ck*P to give...

## Upper triangular...

Hi, I have a list of 15 numbers. I am trying to fit it into a triangular matrix. It will be a 6x6 matrix with zeros in the diagonal lines.

The first number will go into the M12, second number will go into M13, followed by M14... then, the six number will go into M23, seventh number into M24 and so on.

Here is what I got so far:

Z is a diagonal 6x6 matrix

node:=3
for i from 1 to (node*2-1) do

## Trouble with nested loop...

Hi, I have a 18x18 matrix called Lambda.

I'm trying to get NewLambda which consist of "(Lambda(1,1)-Lambda(2,2))/2", "(Lambda(2,2)-Lambda(3,3))/2", ....,"(Lambda(17,17)-Lambda(18,18))/2".

Here is what I wrote :

for i from 1 to 17 do
for j from 2 to 18 do
NewLambda:=((Lambda(i,i)-Lambda(j,j))/2;
end do
end do

But it doesn't show me the NewLambda. Please help. Thanks

## How to put a for loop inside another for...

Hi, I am trying to put a for loop inside another for loop, but it is not working. but if i split it up, it works, may I know what is it i miss out please?

eta is a diagonal matrix.

I tried writting

for i from 1 to 17 do
nod:=(2*(i-1))+1;
diz:=eta(i,i)
end do

for j from 2 to 18 do
nod:=(2*(i-1))+1;
diz2:=eta(j,j)
end do

but when i try to combine it

for i from 1 to 17 do
for j from 2 to 18 do

## asking the right question...

Hi, How do I check what sort of matrix is it by asking the right question?

For example, M is a 3x4Matrix

I type in "whattype(M)", it gives me the answer "matrix".

May I know what I should type so that it shows me that it is a "3x4 Matrix" please?

Thanks

 First 8 9 10 11 12 13 14 Page 10 of 17
﻿