Expand summations with different indexes symbolically

4 views (last 30 days)
Will MATLAB expand summations with different indexes symbolically like this one?

Accepted Answer

Walter Roberson
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
SooShiant
SooShiant on 4 Oct 2015
The same error
evalin(symengine, 'sum((f(I+1)-f(I))*n(I) * sum(m(J), J=I+2..5), I=1..3)')
Error using mupadengine/evalin (line 101)
MuPAD error: Error: The left border must not exceed the right border.
[sum]
You know I had an equation with 17 3-line sums which each contained 6 sums inside. Indexes included i-8 to i+12.
5 minuets ago I overcame to expand it by my own after a week of typing and doning silly calculations. MATLAB could help me and do it in a second. To me it was more civilized to learn MATLAB in a year then use it to perform my order in a second, but I am an engineer who don't have enough time to learn MATLAB completely.
If MATLAB has written just for scientists so its developers should clarify this has produced JUST for scientists not for ordinary people like me. If they want a more global software they should increase their support and spread the solutions. But every time I ask a question here they delete my question and say you should not ask a "do it for me" question! Even I said in a topic that transfer money to every one who can solve my problem but there was no one to help. Sometimes a good man like you care about people and help'em. God bless you. Thanks for your valuable time broth.
Walter Roberson
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

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!