I have :
A =
1 2 3
2 4 5
5 5 5
and
[U S V]=svd(A)
How can I remove the dimension of A matrix from SVD function?
I have :
A =
1 2 3
2 4 5
5 5 5
and
[U S V]=svd(A)
How can I remove the dimension of A matrix from SVD function?
I'm assuming you want to get a reduced version of the matrix A
.
This is done by using PCA
, search it. For example, if you want the reduced matrix A
to have K
dimensions:
[m, ~] = size(A);
Sigma = 1.0/m .* A' * A;
[U, S, ~] = svd(Sigma);
newA = zeros(size(A, 1), K);
for i = 1:size(A, 1),
for j = 1:K,
x = A(i, :)';
projection_k = x' * U(:, j);
newA(i, j) = projection_k;
end
end
end
So the matrix newA
will be a reduced version of A
with K
dimensions.
It's better for you to search about PCA
.