MATLAB: Matrix Multiplication with large vectors

matrices multiplication

Hi,
If I have following problem how can I formulate it in matlab
A=
1 3
2 4
b=
xi
yi
where xi and yi are column vectors with lets say 100 values in each how can I input this problem in Matlab by using following formula
[z1 = A*b
z2]
Please note I have very large martix with vectors xi and yi and I want out put two matrices z1 and z2
Thanks in advance, jay
thanks

Best Answer

T = arrayfun(@(x,y) A*[x;y], xi, yi, 'Uniform', 0);
z1z2 = vertcat(T{:});
z1 = z1z2(:,1);
z2 = z1z2(:,2);
However, this formulation of the code would not be efficient if you had a small A and long vectors. In your actual situation, what size() is your A ?