How do i multiply two functions

11 ビュー (過去 30 日間)
Mihnea Cristian Marin
Mihnea Cristian Marin 2018 年 1 月 14 日
編集済み: Jan 2018 年 1 月 14 日
Hello, i have an assignment for school in which i need to plot the z function, where z needs to be:
z=x1*x2,
x1=29*t^2-165*t+420
x2=x2=symsum((-1)^k*dirac(t-24*k), k, -100, 100),
and t=0:1:24*25 (to represent 25 periods of x2).
But when i try to multiply x1 with x2, i get this error:
Error using symengine, The dimensions do not match.
What can i do?
  1 件のコメント
Jan
Jan 2018 年 1 月 14 日
編集済み: Jan 2018 年 1 月 14 日
Please post the code you have tried for this multiplication. Obviously it contains an error, but if the readers do not know, how you have tried this, they have to guess.
I have formatted your code this time using the "{} Code" button.

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

採用された回答

Birdman
Birdman 2018 年 1 月 14 日
Try this:
syms t k
x1=29*t^2-165*t+420
x2=symsum((-1)^k*dirac(t-24*k), k, -100, 100)
tt=subs(t,0:1:24*25);
x1=subs(x1,t,tt)
x2=subs(x2,t,tt)
z=x1.*x2;

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by