How do i calculate summations using a loop structure?

2 vues (au cours des 30 derniers jours)
Amanda Kit Ting
Amanda Kit Ting le 5 Oct 2013
Hi guys, I'm having trouble trying to put this summation: top of ∑ is N bottom of ∑ is j=1 side of ∑ is j^p For p=1,2,3 and N=6 how do i solve this using matlab? i keep getting error messages.
  1 commentaire
Azzi Abdelmalek
Azzi Abdelmalek le 5 Oct 2013
Where are your code and the error message?

Connectez-vous pour commenter.

Réponse acceptée

cr
cr le 5 Oct 2013
sum((1:6).^p)
use various values of p and you get the result.
  1 commentaire
Amanda Kit Ting
Amanda Kit Ting le 5 Oct 2013
thx for your help. i thought you will need more complex code for this question. Cause this is my first time using Matlab to calculate problems. i appreciate it.

Connectez-vous pour commenter.

Plus de réponses (0)

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!

Translated by