Path: news.mathworks.com!not-for-mail
From: "Colm " <c.oshea4@nuigalway.ie>
Newsgroups: comp.soft-sys.matlab
Subject: Subscript indices are real integers but getting error saying they are not?
Date: Tue, 31 Jul 2007 15:20:36 +0000 (UTC)
Organization: National University of Ireland, Galway
Lines: 17
Message-ID: <f8nk04$7u9$1@fred.mathworks.com>
Reply-To: "Colm " <c.oshea4@nuigalway.ie>
NNTP-Posting-Host: webapp-00-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1185895236 8137 172.30.248.35 (31 Jul 2007 15:20:36 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 31 Jul 2007 15:20:36 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 621891
Xref: news.mathworks.com comp.soft-sys.matlab:421866


Hi,

I have been scratching my head about this one and a look through the other posts hasn't helped so I thought someone might be able to help. I have an m-file in which I form a 4-d double array (11x11x12x26) of sea surface temps (sst) and I want to get the means along the 3rd dimension, so I have a line

avg_sst =  mean(month_array,3)

which gave the error:

"Subscript indices must either be real positive integers or logicals"

so I tried using for loops and reshaping the array, etc but always got the same error.

Can anyone help?

Thanks, 

Colm