Path: news.mathworks.com!not-for-mail
From: "Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de>
Newsgroups: comp.soft-sys.matlab
Subject: Re: average the elements of an array
Date: Fri, 16 Apr 2010 19:45:25 +0000 (UTC)
Organization: Universit&#228;t Heidelberg
Lines: 8
Message-ID: <hqaeol$t5q$1@fred.mathworks.com>
References: <hq8551$hmu$1@fred.mathworks.com>
Reply-To: "Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1271447125 29882 172.30.248.38 (16 Apr 2010 19:45:25 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 16 Apr 2010 19:45:25 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869888
Xref: news.mathworks.com comp.soft-sys.matlab:627323

Dear Matt!

> matrix(x,y) = ((matrix((x-1),y)+matrix(x,y)+matrix((x+1),y))/3);
> However, when I run this code, my matrix never changes.

This line is correct - although it is a really unusual computation as mentioned already. I assume your program has another problem. You cna inspect this by stopping the execution with the debugger: Set a break point with the debugger and step through your program line by line. You can show the contents of variables in the command line.

Good luck, Jan