For best results, replace ‘j’ with ‘1j’, then convert the result to double to use plot (since fplot is likely to be more difficult with discrete values of ‘k1’):
a = (1/T)*int(x*exp(-1j*k1*w*t),t,t0,t0+T);
num_a = double(a);
figure
plot(k1,real(num_a))
hold on
plot(k1,imag(num_a))
plot(k1,abs(num_a),'--k')
hold off
grid
legend('\Re(a)','\Im(a)', '|a|')
That should do what you want.
Otherwise, I would have suggested:
syms k2
a(k2) = (1/T)*int(x*exp(-1j*k2*w*t),t,t0,t0+T);
figure
fplot(real(a), [-2 2])
hold on
fplot(imag(a), [-2 2])
fplot(abs(a), [-2 2], '--k')
hold off
grid
legend('\Re(a)','\Im(a)', '|a|')
.
댓글 수: 0
댓글을 달려면 로그인하십시오.