Originally Posted by

**Zamorano** hey guys

i have a problem with Matlab i could not figure it out

i constructed a Matlab code that shows me all possible values of k and w relating to this equation

w=exp(2*pi*j*k/5) where k=0,1,2 ,3 ,4

so the expected result would be

k w

0 1

1 0.309 + j 0.951

2 -0.809 + j 0.5877

3 -0.809 - j 0.5877

4 0.309 - j 0.951

but the problems is my code does not show me the imaginary part , it shows me only the real part of W as shown in the attached file

i need your help guys

thank you for your cooperations

Not the only thing wrong, but you are trying to print complex numbers using a real format. Try something like:

Code:

'k re(w) im(w)'
for k=0:4
w=exp(2*pi*k*j/5);
printf('%4.2f %14.6f %14.6f \n',k,real(w),imag(w));
end

CB