필터 지우기
필터 지우기

How to apply symsum function for this eqaution

조회 수: 6 (최근 30일)
Phoom
Phoom 2023년 9월 18일
답변: Walter Roberson 2023년 9월 18일
I need help to apply the symsum function with odd number value to this eqaution

답변 (1개)

Walter Roberson
Walter Roberson 2023년 9월 18일
You cannot use symsum() for that purpose.
symsum() expects a formula in a symbolic variable as the first parameter. The formula is used to attempt to calculate a closed form formula for the summation, and if that works then then bounds are used with the closed form formula to calculate a difference. If no closed form can be calculated but the bounds are both finite integers, then the value of the formula is calculated at each integer from the lower bound to the upper bound and the terms are added together.
The formula cannot contain any indexing of an array by a symbolic variable. It is never possible to index anything by a symbolic variable..
You need to calculate the individual terms of the formula, and sum() them together. You can do that because the memory block is a fixed finite size. If you are trying to represent a memory block that is an indefinite size but which indexes arrays, then you simply cannot do that.
If you are trying to represent a memory block that is of indefinite size, then you can get something quite similar to your target by replacing your arrays v and w by functions v(n) and w(n), as in
symfun v(n) w(n)
and if that is done then you can use symfun() . But if you do this then at some point you need to subs() an expression for the function where the expression acts to index an array, such as
v_(n) = piecewise(n==1, V(1), n == 2, V(2), ... ) %every term must be listed
subs(FORMULA, v, v_)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by