Is there a way I could vectorize this for loop and make it faster in MATLAB for large n?
for j=1:n
% find point coordinate in a different basis
pt_2(:,:,j) = Mat(:,:,t(j)) * pt_1(:,:,j);
end
where pt_1, pt_2 are 3x1xn arrays, Mat is a 3x3xm array, and t is a nx1 vector. The loop wants to get n point coordinates transformed from n coordinates of another linear space, and there are m different transformations.