2
votes

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.

2

2 Answers

1
votes

You can use discrete plot:

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

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