From: Bjoern Eskofier on
Hello,

I have the following problem: I am computing a relatively large matrix multiplication, and MATLAB has a memory problem. I need, however, just a single row from the multiplication result:

mult_res = matrix_a*matrix_b;
needed_res = mult_res(size(matrix_a,1)/2,:)

where matrix_a is 4096x36
and matrix_b is 36x40000

How can I compute my needed_res fast and memory-efficient? A probably simple task, but I can't see how to do that without a for-loop, which I'd like to avoid, of course.

Cheers,
Bjoern
From: Matt J on
"Bjoern Eskofier" <bjoern(a)lastname.as.you.see.above.eu> wrote in message <hpj3rc$oft$1(a)fred.mathworks.com>...
> Hello,
>
> I have the following problem: I am computing a relatively large matrix multiplication, and MATLAB has a memory problem. I need, however, just a single row from the multiplication result:
>
> mult_res = matrix_a*matrix_b;
> needed_res = mult_res(size(matrix_a,1)/2,:)
>
> where matrix_a is 4096x36
> and matrix_b is 36x40000
>
=============


If you need the j-th row of the result, you would do

needed_res=matrix_a(j,:)*matrix_b
From: Bjoern Eskofier on
Yeah,

The thing with the wood and the trees. Thanks a lot.

Cheers,
Bjoern