From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: arithenco Help
Date: Tue, 21 Apr 2009 16:26:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <gsks2r$247$>
References: <gskiqh$hie$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1240331163 2183 (21 Apr 2009 16:26:03 GMT)
NNTP-Posting-Date: Tue, 21 Apr 2009 16:26:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:534432

"Garry Higgins" <> wrote in message <gskiqh$hie$>...
> Hi,
> I'm trying to use the Arithmetic Encoder function in MATLAB (arithenco) and am looking for some help.
> I have a 1x7500 array of values that range from 0 to 0.9998. Of these values 7492 of them are unique. I'm having trouble figuring out how to calculate the "counts" vector that needs to be passed to the arithenco function. Here's what I've tried:
> counts = histc(A, unique(A));
> But this gives me a 1x7492 double ranging from 1 to 9 which I know isn't right. I thought histc would be the correct function to use from reading it's help page and I saw a similar example using it elsewhere. Is there something else I should be using instead or am I doing something else wrong that I'm not seeing?
> Hope you guys can help. I don't have a huge amount of MATLAB experience.

  What makes you think the 'counts' values are not right?  The 'histc' function is telling you that of the 7492 unique values in A, all but one of them occur only once each and that remaining value occurs nine times.  What is not right about that?

  Of course with statistics like that, you will not be able to gain much compression with 'arithenco', but that is not the fault of 'histc', it is a problem with your particular A.  What else could it do with an alphabet of length 7492?  I think you had better review what it is you are trying to accomplish.  It sounds as if the A array is inappropriate.

Roger Stafford