Gennaro Arguzzi
Gennaro Arguzzi

Reputation: 857

Plot a function with an integer variable in Wolfram Alpha

I'd like to plot the following function in Wolfram Alpha (n is a positive integer variable):

f = n * (2^(-n) - 1)

In Matlab the corresponding function is stem

How can I specify that n is a positive integer variable?

Thank you for your time.

Upvotes: 3

Views: 2114

Answers (2)

relatively_random
relatively_random

Reputation: 5166

You can use discrete plot:

discrete plot f = n * (2^(-n) - 1) for 0 < n <= 10

Upvotes: 2

Jimi
Jimi

Reputation: 1855

You can append a plot keyword at the beginning of your function. So, in your case, it would be something like this

plot f = n * (2^(-n) - 1) with n > 0

which will give the following result

Upvotes: -1

Related Questions