Path: news.mathworks.com!not-for-mail
From: "Anna Chen" <icedredtea@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Creating a new vector based on unique entries
Date: Thu, 14 May 2009 13:46:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 13
Message-ID: <guh7ap$s7n$1@fred.mathworks.com>
Reply-To: "Anna Chen" <icedredtea@yahoo.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1242308762 28919 172.30.248.38 (14 May 2009 13:46:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 14 May 2009 13:46:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1455324
Xref: news.mathworks.com comp.soft-sys.matlab:539912


Hello there,
I have a question on something that I just can't seem to get to work correctly.  I have a dataset imported from excel that looks like this:

cat          2
cat          3
cat          0
dog         4
dog         5
mouse     6

Where the first column is cell and the second is double.  How would I create a vector that has three elements, the first that averages all the "cats," the second that averages all the "dogs" and the third that averages all the "mice"?  I've been trying combinations of for and while loops, but the different data classes are messing me up!

Thanks!