Evaluation of an expression with symbols
2 views (last 30 days)
Show older comments
Dear all, I am new to MATLAB and I was wondering is there a way to expand out an expression that has symbols within it?
Is there a way to simplify the left hand side to get the right hand side polynomial?
Thanks all in advance!
3 Comments
Walter Roberson
on 8 Apr 2020
As I said, that will give you the summation expression, but only partly evaluated. That is not an error you are seeing, that is the output of the expression.
You can evaluate for any given number by using subs,
subs(A, N, 17)
At the moment I cannot think of any way to get it to automatically produce the desired output.
I would point out, however, that you can break the inner sum into two ranges: one for j = 1, and one for j = 2 to n. The one for j=1 is the only one for which the max() changes the result, so you can evaluate that one directly using the 0. The other case j=2 to n, the max does not change the value so you can remove it and use (j-2) directly in the formula. You would then have symsum() with respect to i, of (symsum() for j=1 plus symsum() for j=2 to n)
Answers (0)
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!