3

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.

Jimi
  • 1,605
  • 1
  • 16
  • 33
Gennaro Arguzzi
  • 769
  • 1
  • 14
  • 27

2 Answers2

2

You can use discrete plot:

discrete plot f = n * (2^(-n) - 1) for 0 < n <= 10
relatively_random
  • 4,505
  • 1
  • 26
  • 48
-1

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

Jimi
  • 1,605
  • 1
  • 16
  • 33