can i use two symsum functions (two summations) together in one quations in my matlab code?
4 views (last 30 days)
Show older comments
i want to use two summations one for i 0 to786 and second for j 0 to 1024 in my matlab code....so can i use two symsum functions together in one equation one with variable i and other with j...
pls help me and reply me asap..
0 Comments
Answers (1)
Vidhi Agarwal
on 30 May 2025
Edited: Vidhi Agarwal
on 30 May 2025
Yes, in MATLAB you can absolutely use two symsum functions together, one for each symbolic variable, to represent double summation.
Below is a basic implementation of how to do it with two symbolic summations:
syms i j
% Define the expression to sum over
expr = i + j; % Example: any symbolic expression involving i and j
% Double summation: outer sum over i = 0 to 786, inner sum over j = 0 to 1024
total_sum = symsum(symsum(expr, j, 0, 1024), i, 0, 786);
For better understanding of "symsum" refer to the following documentation:
Hope this helps!
0 Comments
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!