1% a sum function 2function p = vector_sum(x) 3p = 0; 4for k1 = 1:length(x) 5 p = p + x(k1); 6end 7end 8 9z = 1:10; 10sum_from_1_to_10 = vector_sum(z)
View as plain text