Path: news.mathworks.com!not-for-mail
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$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1240321681 17998 172.30.248.37 (21 Apr 2009 13:48:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 21 Apr 2009 13:48:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1810775
Xref: news.mathworks.com comp.soft-sys.matlab:534390

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.