how to write this summation in matlab form ∑_(u=1)^(su-2)?

4 vues (au cours des 30 derniers jours)
Dhines
Dhines le 8 Oct 2012
Commenté : SARSKOLIN FOSSO le 6 Juil 2021
in this summation..the lower limit is u=1 and the upper limit is su-2. how can i write this summation limits in matlab form?
  1 commentaire
Greg Heath
Greg Heath le 8 Oct 2012
Please write the complete mathematical command that is to be translated to MATLAB code

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 8 Oct 2012
If you have the symbolic toolbox, use symsum()
syms u
symsum(YourExpression, u, 1, su-2)
If you do not have the symbolic toolbox, then either use a for loop that accumulates the results, or else use an expression that calculates each term independently and then sum() them together. You could also consider using arrayfun()
arrayfun(@(u) YourExpression, 1:su-2)
  5 commentaires
Rajnish kumar
Rajnish kumar le 16 Fév 2015
But symsum shows error if we have summation of h(k)x(n-k) for k=1 to L; let L=10; Undefined function 'symsum' for input arguments of type 'double'.
Error: y(n)=symsum(h(r).*x(n-r),r,1,L);
SARSKOLIN FOSSO
SARSKOLIN FOSSO le 6 Juil 2021
yes i had this error.....it is because symsum became the function

Connectez-vous pour commenter.

Plus de réponses (1)

Sudhanshu Gaurav
Sudhanshu Gaurav le 7 Avr 2021
Modifié(e) : David le 7 Avr 2021
min K k=1 n +1 i=0 n +1 j=0 cijxijk
  1 commentaire
Walter Roberson
Walter Roberson le 7 Avr 2021
Modifié(e) : Walter Roberson le 7 Avr 2021
I am not sure why your post did not show up; I will ask staff.
You posted
min K k=1 n +1 i=0 n +1 j=0 cijxijk

Connectez-vous pour commenter.

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by