# Matlab ( Matrix )

• Apr 5th 2009, 05:23 AM
Zamorano
Matlab ( Matrix )
Hello
i have 3 variables w,r,d as shown in the attached file (number 1)
i tried to put the vaules of all variables in a single Matrix (y) as shown in the attached file (number 2) but i could not
my result was like this
y= w1 r1 d1
y= w2 r2 d2
y= w3 r3 d3

my goal is to have a matrix (y) as shown in the attached file (number 3) as a form of
y=
w1 r1 d1
w2 r2 d2
w3 r3 d3
then find the value of y(2,2) which is r2 =0.5000 + 0.8660i

the code of number (1) is:

n=2;
for k=0:n
w=exp((2*pi*k*j)/(n+1))
r=w+1
d=r/w
end

thank you
• Apr 5th 2009, 11:51 PM
CaptainBlack
Quote:

Originally Posted by Zamorano
Hello
i have 3 variables w,r,d as shown in the attached file (number 1)
i tried to put the vaules of all variables in a single Matrix (y) as shown in the attached file (number 2) but i could not
my result was like this
y= w1 r1 d1
y= w2 r2 d2
y= w3 r3 d3

my goal is to have a matrix (y) as shown in the attached file (number 3) as a form of
y=
w1 r1 d1
w2 r2 d2
w3 r3 d3
then find the value of y(2,2) which is r2 =0.5000 + 0.8660i

the code of number (1) is:

n=2;
for k=0:n
w=exp((2*pi*k*j)/(n+1))
r=w+1
d=r/w
end

```n=2; xx=[]; for k=0:n w=exp((2*pi*k*j)/(n+1)); r=w+1; d=r/w;   xx=[xx;[w,r,d]]; end   xx```