SUM OF (-1^K)/FACTORIAL(K+1)

9 views (last 30 days)
blake brandt
blake brandt on 19 Nov 2019
Commented: Star Strider on 19 Nov 2019
PLEASE HELP!
I CAN NOT FIGURE OUT HOW TO MAKE A SUM OF k = 1 TO 6
(-1)^K/(FACTORIAL (K+1)

Answers (2)

Star Strider
Star Strider on 19 Nov 2019
First, use element-wise operations:
k = 1:6;
v = (-1).^k./factorial(k+1)
sv = sum(v)
See Array vs. Matrix Operations for a detailed discussion.

blake brandt
blake brandt on 19 Nov 2019
how would i solve this using a while loop?
  1 Comment
Star Strider
Star Strider on 19 Nov 2019
Thia seems to be homework, so write it and find out!

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!