From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: arithenco Help
Date: Tue, 21 Apr 2009 13:48:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 11
Message-ID: <gskiqh$hie$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1240321681 17998 (21 Apr 2009 13:48:01 GMT)
NNTP-Posting-Date: Tue, 21 Apr 2009 13:48:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1810775
Xref: comp.soft-sys.matlab:534390


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.