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? Could i have p=1,2,3 all under one script?
clc j=1; p=1; sum=0; disp('j p j^p') disp('-----------------') while (j<=6) square=j.^p; sum=sum+square; fprintf('%d %d %d\n', j,p,square); j=j+1;
Best Answer