Expand summations with different indexes symbolically
4 views (last 30 days)
Show older comments
SooShiant
on 2 Oct 2015
Commented: Walter Roberson
on 4 Oct 2015
Will MATLAB expand summations with different indexes symbolically like this one?
0 Comments
Accepted Answer
Walter Roberson
on 3 Oct 2015
MATLAB does not offer a ∑ operator.
MATLAB offers sum(), which when applied to numeric values, just adds the values.
If you have the Symbolic Toolbox, then can sum() a symbolic expression that has a symbolic subscript; the result will be expanded if it is simple enough.
11 Comments
Walter Roberson
on 4 Oct 2015
Sorry, I do not have that toolbox to test with. You could try
evalin(symengine, 'sum((f[I_+1]-f[I_])*n[I]*(sum(m[J], J = I_+2 .. 5)), I_ = 1 .. 3)');
MATLAB was not written for scientists. The initial development was done by Dr. Cleve Moler, but it was recognized that it was the Engineers who really liked it and it was developed as a commercial product on that basis. See http://www.mathworks.com/company/newsletters/articles/the-origins-of-matlab.html
MATLAB was not developed with a symbolic system. For a number of years, Mathworks partnered with Maplesoft to use Maple for symbolic computations. For reasons I have not been told, Mathworks purchased SciFace (manufacturers of MuPAD) in 2008, and the next year stopped partnering with Maplesoft, using MuPAD instead. They have improved MuPAD and the interface to the symbolic engine since then, but they are quite distinct products and it is not expected at this time that everything is going to be accessible from the MATLAB level.
Mathworks offers this forum, but it is volunteers who answer the questions here. Sometimes the volunteers work for Mathworks, but it is mostly users helping other users.
One of the activities of the volunteers is to remove duplicate questions such as you had posted. Duplicate questions lead to confusion, and lead to incomplete answers because no-one ever bothers to go and find duplicate questions and post the answer to them. That makes it difficult for other people to search the forum to find questions similar to their own -- and that is one of the most important functions of the Answers forum, to be a place that people can search what has already been done before to find out how to do something. The more time the volunteers have to spend finding and merging or deleting duplicate questions, the less time the volunteers have available to spend answering the questions. The volunteers tend to get a bit grumpy about that.
The volunteers also get grumpy when postings are phrased as orders to do something, rather than as questions.
What makes the volunteers most grumpy is if someone posts that their question is Urgent or an Emergency
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!