usage of cumprod function to write the code
조회 수: 2 (최근 30일)
이전 댓글 표시
To create a vector t, where
t = [1 u/1! u(u-1)/2! u(u-1)(u-2)/3! ... (u(u-1)..(u-(n-2)))/(n-1)!
I wrote the following code as
t(1)=1;
for i=2:n
t(i)=t(i-1)*(u-(i-2))/(i-1)
end
Is it possible to create the above vector using 'cumprod' function
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!