Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: Simple Summation
Posted:
Feb 22, 2013 2:20 AM


On Friday, February 22, 2013 5:55:12 PM UTC+13, Katherine wrote: > How do I create a matlab code that sums the values going from i:n where i=1 > > The input argument is n. > > ? The output argument is the summation. > > > > so far I have: > > function[total_sum]=ICA07B_isum_ktomato(i,n) > > > > for i=1:n; > > total_sum= i+ sum(i:n) > > end > > > > > > but this is wrong. please help me
Homework, isn't it? Hint: what does: n=5; sum(1:n) give?



