How can I multiply 2 signals?

조회 수: 27 (최근 30일)
RandomChikiBum
RandomChikiBum 2021년 12월 26일
답변: DGM 2021년 12월 26일
I tried to plot the graph of product of 2 signals (Cosine and and decaying exponential) but am getting an error
x = (-100 :.05 :100);
y = cos(2*pi*x).exp(-x);
Dot indexing is not supported for variables of this type.
plot(x,y);
figure ;
title('Task-4 Cosine mutliplied with decaying exponential signal');
xlabel('Time');
ylabel('Amplitude');
  댓글 수: 1
RandomChikiBum
RandomChikiBum 2021년 12월 26일
편집: RandomChikiBum 2021년 12월 26일
And how can I multiply the power of the exponent with a constant?
like e^(-5x) or using decimal numbers?

댓글을 달려면 로그인하십시오.

채택된 답변

DGM
DGM 2021년 12월 26일
Something like
x = (-1 :.05 :1); % pay attention to scale and limits
y = cos(2*pi*x).*exp(-5*x); % elementwise multiply with .*
plot(x,y);
title('Task-4 Cosine mutliplied with decaying exponential signal');
xlabel('Time');
ylabel('Amplitude');

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by