Summation with FOR loop question
이전 댓글 표시
I am fairly new to MATLAB. How do you get an answer for this using a FOR loop?

채택된 답변
추가 답변 (2개)
Geoff Hayes
2019년 2월 14일
2 개 추천
Oliver - since this is most likely homework and I'm assuming that you have been instructed to use a for loop, see for loop to repeat specified number of times and factorial. An alternative to using a loop is vecorization..see using vectorization for more details.
format long
fak = 1.0;
s = fak;
for i = 1:1600
fak = fak/i;
s = s + fak;
end
s
exp(1)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!