Please how can I calculate the values of this finite sum of numbers in fully sequential , I'm finding it difficult
    6 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    

0 commentaires
Réponses (3)
  Antoni Garcia-Herreros
      
 le 27 Mar 2023
        Hello,
You can try something like this:
n=1000; %Specify your n
SUM=zeros(n,1);
for i=1:n;
    SUM(i)=1./i^4;
end
value=sum(SUM); %This is the result of your sum 
8 commentaires
  Walter Roberson
      
      
 le 28 Mar 2023
				n=1000; %Specify your n
SUM=zeros(n,1);
parfor i=1:n;
    SUM(i)=1./i^4;
end
value=sum(SUM); %This is the result of your sum 
  John D'Errico
      
      
 le 27 Mar 2023
        
      Modifié(e) : John D'Errico
      
      
 le 27 Mar 2023
  
      Easy peasy.
sumof4thpowers = @(N) nchoosek(N+1,5) + 11*nchoosek(N+2,5) + 11*nchoosek(N+3,5) + nchoosek(N+4,5);
For example:
sumof4thpowers(4)
Was it correct?
1^4 + 2^4 + 3^4 + 4^4
Note that you asked only how to compute the sum, not how to derive the expresssion I gave. But they can be shown to be equivalent.
2 commentaires
  Walter Roberson
      
      
 le 27 Mar 2023
        
      Modifié(e) : Walter Roberson
      
      
 le 27 Mar 2023
  
      Example:
syms i n
symsum(i^(-7), i, 1, n)
char(ans)
0 commentaires
Voir également
Catégories
				En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






