How can I have the cumulative sum of the returned values of a function as a vector?
조회 수: 1 (최근 30일)
이전 댓글 표시
I want to have the cumulative sum of the returned values of AB function in a loop...I want the cumulative sum of the returned values of AB function to form a vector every time it is used. Would you please help me?
for i = 1:P
for j = 1:L
for k = 1:(D / 6)
H = AB (Min{j}(k), Max{j}(k));
end
end
end
댓글 수: 2
Marc Jakobi
2016년 10월 8일
You should provide more information. What is P? What is L? what is D? You said AB is a function? What is it supposed to return?
답변 (1개)
Blackadder
2016년 10월 9일
You say you expect a "vector" as a return value. Am I to assume that this vector should have 1 column and P*L*(D/6) rows, or vice versa, respectively?
댓글 수: 2
Blackadder
2016년 10월 9일
편집: Blackadder
2016년 10월 9일
So AB can return a vector? Only then would a vector that contains all the H not have the length P*L*(D/6).
And if so, one further question: is there a maximum length to the vector returned by AB?
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!