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?