I need to multiply a list vectors by a list of matrices. Currently I am doing it with a for loop:
for k=1:N
x(:,k)= A(:,:,k) \ b(:,k);
end
Can I write this without the for
loop?
I need to multiply a list vectors by a list of matrices. Currently I am doing it with a for loop:
for k=1:N
x(:,k)= A(:,:,k) \ b(:,k);
end
Can I write this without the for
loop?
Copyright © 2021 Jogjafile Inc.
If you're really looking for a solution (which might be slower ; you need to profile), I'd store my matrices in a cell array (such that
A(:,:,k) = A{k}
). Then: