フィルターのクリア

Sysmsum gives wrong output

2 ビュー (過去 30 日間)
Mohamed Musni
Mohamed Musni 2018 年 1 月 23 日
コメント済み: Stephen23 2018 年 1 月 23 日
For this code im getting output as below. But its multiplied with 3 in every term. What am I doing wrong here? Because I don’t need that multiplication with 3
  1 件のコメント
Stephen23
Stephen23 2018 年 1 月 23 日
@Mohamed Musni: please do not post screenshots. It is actually easier for us when you post real text: this includes the code and any error messages. Real text can be searched (or searched for), edited, and run. Screenshots are basically useless in most cases.

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

採用された回答

Birdman
Birdman 2018 年 1 月 23 日
Actually, your code displays the correct output because you try to implement the series sum with respect to a different variable k, which is not included in any of your other symbolic variables. Therefore your series turns into something that multiplying a constant value with m, which is 3 in this case.
((((q.*t)./2).*h)+P)./t
>> [q1 + 10, (3*q2)/2 + 10, 2*q3 + 10]
As you see, q symbolic variable is not dependent on k, therefore your symsum will be multiplied by m directly. 3 comes from that.
symsum(((((q.*t)./2).*h)+P)./t,k,1,m)
>> [3*q1 + 30, (9*q2)/2 + 30, 6*q3 + 30]
  3 件のコメント
Birdman
Birdman 2018 年 1 月 23 日
Yes, you can change the upper limit dependent on k as follows:
symsum(((((q.*t)./2).*h)+P)./t,k,1,m+k)
Mohamed Musni
Mohamed Musni 2018 年 1 月 23 日
Thank you. have a nice day :D

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by