how to write delta function like this?

조회 수: 7 (최근 30일)
Kuheli Mondal
Kuheli Mondal 2016년 3월 31일
댓글: Ced 2016년 3월 31일
h(n)=delta(n-3)-2*delta(n-4); delta(n==0)=1 can any one help me. Thank you.
  댓글 수: 1
Ced
Ced 2016년 3월 31일
The delta function in this case is defined as
"if n is equal to 0, then the function value is 1, else, the function value is 0"
You can implement it just like that in matlab.

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

답변 (1개)

Jan
Jan 2016년 3월 31일
delta = (n==0);
  댓글 수: 1
Ced
Ced 2016년 3월 31일
Did you mean to write
delta = @(n)(n==0);
?

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

카테고리

Help CenterFile Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by