Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: compute distribution

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82497] Re: compute distribution
  • From: Valeri Astanoff <astanoff at gmail.com>
  • Date: Mon, 22 Oct 2007 05:41:15 -0400 (EDT)
  • References: <fff50c$eu3$1@smc.vnet.net>

On 21 oct, 11:09, vickyi... at gmail.com wrote:
> Hi ALL
>
> How can i compute the distribution of signals fired from a net . ther
> are 26 different signals that can be fired.
> which is obtained the form below.
>
> { ammmmmstgretsrdhydtudytyhsdefaweshgffdyhsfdhsgfjsdfdsfhkpgfkjgfjhkjhfdg=
kbfs=ADdnfjkdsglhdsjfkgndsjgh}
>
> i ma confused with how to show the distribution plot. If i compute the
> "number of times" each signal has occured, than how it can be
> plotted.  (like a appears 12 times, b appears 13 times....than
> frequency of appearance can be represented on y axis but what can i
> take on x axis.
>
> I work on mathematica 5.2
>
> thnaks
>
> Vick Al Aisa

Good day,

Here is one way to do it, using character codes :

In[1]:=<<Statistics`

In[2]:=s =
"ammmmmstgretsrdhydtudytyhsdefaweshgffdyhsfdhsgfjsdfdsfhkpgfkjgfjhkjhfdgkbf=
sdnfjkdsglhdsjfkgndsjgh";

In[3]:=cc=s//Characters//ToCharacterCode//Flatten;

In[4]:=bc={Range[Min[cc],Max[cc]],BinCounts[cc,{Min[cc]-1,Max[cc]}]}//
Transpose

Out[4]={{97,2},{98,1},{99,0},{100,13},{101,3},{102,13},{103,9},
{104,10},
{105,0},{106,7},{107,6},{108,1},{109,5},{110,2},{111,0},{112,1},
{113,0},{114,2},{115,12},{116,4},{117,1},{118,0},{119,1},{120,0},
{121,4}}

In[5]:=ListPlot[bc,PlotJoined -> True]
Out[5]=-Graphics-

In[6]:=$Version

Out[6]=5.1 for Microsoft Windows (January 28, 2005)


V=2EAstanoff



  • Prev by Date: Re: Re: why no result & no error from this recursion
  • Next by Date: Re: Returning rules from functions inside a package context
  • Previous by thread: Re: compute distribution
  • Next by thread: Re: compute distribution