Write a relational expression for a vector variable that will verify that the last value in a vector created by cumsum is the same as the result returned by sum
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:2| Question number:34.2
All Answers
total answers (1)
>> vec = 2:3:17
vec =
2 5 8 11 14 17
>> cv = cumsum(vec)
cv =
2 7 15 26 40 57
>> sum(vec) == cv(end)
ans =
1
need an explanation for this answer? contact us directly to get an explanation for this answer