フィルターのクリア

sum of dirac delta function

28 ビュー (過去 30 日間)
Dharma Khatiwada
Dharma Khatiwada 2022 年 4 月 26 日
コメント済み: Dharma Khatiwada 2022 年 4 月 26 日
Hi,
I am trying to write a single sum of many dirac terms like dirac(x-1)+dirac(x-4)+dirac(x-7)+dirac(x-10) and so on. There is an increment of 3 in each sucessive term and it can go quite far like 200. Can we write a code that just sums all dirac terms like a series?
Thanks
Dharma
syms x t
y(x) = (dirac(x-1) + dirac(x-4)+................;
z = y(x)* exp(-4*(t-x));

採用された回答

Paul
Paul 2022 年 4 月 26 日
syms d(x) t
d(x) = dirac(x);
t0 = 1:3:10; % a couple of terms for example
y(x) = sum(d(x-t0))
y(x) = 

その他の回答 (1 件)

Chunru
Chunru 2022 年 4 月 26 日
syms x t
y(x) = dirac(x-1);
for i=4:3:200
y(x) = y(x) + dirac(x-i);
end
z = y(x)* exp(-4*(t-x));
y
y(x) = 
z
z = 
  1 件のコメント
Dharma Khatiwada
Dharma Khatiwada 2022 年 4 月 26 日
Thank You.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeFormula Manipulation and Simplification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by