Vectorization: matrix array multiplication element wise one by one

Viewed 155

I have a matrix:

R = [0 -1;1 0];

array = 1:1:10;

Also x0 = [2;1]

How can I obtain another array in the most efficient way without loop?

array2 = [expm(1*R) expm(2*R) expm(3*R) .... expm(10*R)];

Then I want to obtain array3 of dimension 2 by 10 such that:

array3 = [expm(1*R)*x0 expm(2*R)*x0 expm(3*R)*x0 .... expm(10*R)*x0];
3 Answers
Related