MATLAB: Multiplying matrix by another matrix element and using it in a command

expmmultiplying

Q=[-0.0905 0.0604 0.0301;0.142 -0.239 0.097;0 0 0];
T =[ 1, 3, 5, 7, 10];
e=expm(Q*T); %%% the problem is here
I have a problem with calculating e, i want to multiply Q with each value of T and still use the expm command

Best Answer

clear e
for i=numel(T):-1:1
e(:,:,i)=expm(Q*T(i));
end