Please, how to plot for this code?

1 visualización (últimos 30 días)
soe min aung
soe min aung el 25 de En. de 2021
Respondida: KSSV el 25 de En. de 2021
k = -2:0.1:2;
g = ((2*cos(2*k))-2)/(1i*k);
plot(k,g)

Respuesta aceptada

KSSV
KSSV el 25 de En. de 2021
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')

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by