Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to get multiprod working
Date: Sat, 22 Jan 2011 04:47:05 +0000 (UTC)
Organization: Boeing Co
Lines: 28
Message-ID: <ihdng9$jbp$1@fred.mathworks.com>
References: <ihal0c$l8n$1@fred.mathworks.com> <iham08$pjm$1@fred.mathworks.com> <ihbppt$nl1$1@fred.mathworks.com> <ihc5pk$o8u$1@fred.mathworks.com> <ihddhg$hhd$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1295671625 19833 172.30.248.38 (22 Jan 2011 04:47:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 22 Jan 2011 04:47:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 756104
Xref: news.mathworks.com comp.soft-sys.matlab:705310

"Jonathan W Smith" wrote in message <ihddhg$hhd$1@fred.mathworks.com>...
> 
> I have 2 matrices A(6,6,4,24,28) and B(6,6,28)  I want to do the following A(6,6,1,1,1) x B(6,6,1) ... A(6,6,4,24,28) x B(6,6,28) but only when the 5th dimension of A and 3rd dimension of B match.

C = mtimesx(A,reshape(B,6,6,1,1,28));

> I was getting erroneous values for the elements in the 6x6 matrices when using multiprod.

I am not familiar enough with multiprod to know the proper input dimensions needed to do the calculation you want in multiprod. Maybe the following will work:

C = multiprod(A,reshape(B,6,6,1,1,28));

> I do not have visual basic that allows me to use mtimesx.

MTIMESX does not need Visual Basic, or anything from Visual Studio. It can be used by anyone with any C compiler that compiles mex routines, and that includes the lcc compiler that comes shipped with MATLAB. You can build MTIMESX on a Windows system as follows:

- Download from the FEX (I assume you have already done this)
- Copy the files to one of your directories that is on the MATLAB path (see Steve Lord's post).
- Issue the following commands:

mex -setup
(Wait for the prompt, then press Enter)
(Select a C/C++ compiler, such as lcc)
mtimesx % This will cause mtimesx to self-build

If you have a Mac or other Unix/Linux type system, the build routine is not automated. If that is the case let me know and I can try to help with this.

James Tursa