How to write delta in matlab?

x2[n]= 2delta[n] - u[n - 1] + u[n - 3]
How to I type this in matlab? Like what is the syntax for delta in matlab?

댓글 수: 3

SZ N
SZ N 2020년 10월 16일
Like in this question. How do i tyoe it in matlab? It is givig me an error while typing delta.
The error:
Ragab
Ragab 2023년 10월 24일
\delta(t)

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

답변 (2개)

Walter Roberson
Walter Roberson 2023년 10월 24일

0 개 추천

Like what is the syntax for delta in matlab?
MATLAB does not have the delta operator. The suggested dirac() does not work for this purpose:
n = [-1 0 1]
n = 1×3
-1 0 1
dirac(n)
ans = 1×3
0 Inf 0
dirac(sym(n))
ans = 
but your delta function should be 1 at parameter 0.
You need to define it yourself, such as
delta = @(x) double(x==0);
delta(n)
ans = 1×3
0 1 0

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2020년 10월 16일

답변:

2023년 10월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by