Trouble with symsum function

3 ビュー (過去 30 日間)
Alec Betancourt
Alec Betancourt 2018 年 4 月 23 日
コメント済み: Alec Betancourt 2018 年 4 月 24 日
Hello,
I am currently trying to calculate a scalar using the sum of two predetermined numbers and the summation of a small operation applied to values in a column matrix. The two predetermined numbers are the ends of the matrix, but the other part of the summation is what is tripping me up. I would like to index the matrix in a general form ( as the size of the column matrix will change with different inputs. I get an error that states "Index exceeds matrix dimensions." How can I fix this, I am not sure where I am going wrong. Here is my code so far:

採用された回答

Walter Roberson
Walter Roberson 2018 年 4 月 24 日
You can never use a symbolic variable as an index.
symsum is for finding closed form formula, not for adding a definite sequence of terms. If the number of terms is known then calculate them all in vector form and sum() the calculated elements.
  1 件のコメント
Alec Betancourt
Alec Betancourt 2018 年 4 月 24 日
Thanks a lot!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by