can i use two symsum functions (two summations) together in one quations in my matlab code?

4 vues (au cours des 30 derniers jours)
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..

Réponses (1)

Vidhi Agarwal
Vidhi Agarwal le 30 Mai 2025
Modifié(e) : Vidhi Agarwal le 30 Mai 2025
Hi @Aditi,
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!

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by