Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'About counting elements' topicStudent Support Forum > General > Archives > "About counting elements"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
01/24/13 10:59pm

In Response To 'Another question'
---------
http://reference.wolfram.com/mathematica/ref/Piecewise.html

In[1]:= dist[x_]:=Piecewise[{{.1,x==2},{.1,x==-2},{.2,x==1},{.2,x==-1},{.4,x==0},{0,True}}]

In[2]:= dist[2]

Out[2]= 0.1

In[3]:= dist[-1]

Out[3]= 0.2

In[4]:= dist[3]

Out[4]= 0

URL: ,

Subject (listing for 'About counting elements')
Author Date Posted
About counting elements Matt 01/21/13 8:42pm
Re: About counting elements Bill Simpson 01/22/13 9:35pm
Re: Re: About counting elements Matt 01/23/13 4:04pm
Re: Re: Re: About counting elements yehuda 01/24/13 05:00am
Another question Matt 01/24/13 12:07pm
Re: Another question yehuda 01/24/13 6:17pm
Re: Another question Bill Simpson 01/24/13 10:59pm
< Previous CommentHelp | Reply To Comment | Reply To Topic