Please, how to plot for this code?

1 次查看(过去 30 天)
k = -2:0.1:2;
g = ((2*cos(2*k))-2)/(1i*k);
plot(k,g)

采纳的回答

KSSV
KSSV 2021-1-25
Read about element by element operations.
k = -2:0.1:2;
g = ((2*cos(2*k))-2)./(1i*k); % use ./
plot(k,abs(g))
hold on
plot(k,real(g))
plot(k,imag(g))
legend('abs','real','imaginary')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by