From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Calculting incomplete convolution
Date: Thu, 22 Jan 2009 23:09:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 26
Message-ID: <glauae$9pi$>
References: <glarf5$nb7$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1232665742 10034 (22 Jan 2009 23:09:02 GMT)
NNTP-Posting-Date: Thu, 22 Jan 2009 23:09:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:513293

"Stefan Hovens" <> wrote in message <glarf5$nb7$>...
> I want to write the following program in Matlab, because excel can cope anymore
> Given:
> Matrix A consisting of 20 columns and 2000 rows which will not change
> Matrix B consisting of 200 columns and one row which will not change
> Matrix C consisting of 1 colmn and 2000 rows which will change
> Created during program :
> Matrix D consisting of 1 column of 2000 rows which will change
> Look up the element x (1 to 2000) in matrix A and remeber the row as y and the colmn as z
> Multiply the element in colmn y in Matrix B with the element in row z in Matrix C and add it to a new Matrix D in row x. When the element x is present more than once in matrix A than add it to the value that is already created in Matrix D.
> For x<1 add the value for Matrix D in row of x=1
> For x>2000 add the value for matrix D in row of x=2000
> Compare values of Matrix C with those of Matrix D, when the difference is less then p store Matrix D, else store Matrix D as Matrix C and start over again.
> This is a problem of an incomplete convolution. It can be written down much shorter, but I'm not able to do that YET.

  Your wordage would imply that there are as many rows in A as there are columns in B, and as many columns in A as there are rows in C, but neither fact is true as you have described the sizes of A, B, and C.  Assuming this is somehow repaired, it looks as though you have something that 'accumarray' could handle quite easily in computing D.

  A and D are not of the same sizes.  What do you mean by their "difference" being less than p?

Roger Stafford