Please, how to plot for this code?

조회 수: 1 (최근 30일)
soe min aung
soe min aung 2021년 1월 25일
답변: KSSV 2021년 1월 25일
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에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by