function [ v ] = flatten( A )
%FLATTEN Vectorizes a given set of factor matrices A.

v = [];
for r = 1 : size(A{1},2)
    for k = 1 : length(A);
        v = [v; A{k}(:,r)];
    end
end
end

