function space = spaceperc(A, k) % given matrix A and top number k of eigenvalues % difference in size of A mxn and SVD U,S,V top k in percentage is given % size U=mxm (mxk), S=mxn (diag k), V=nxn (nxk) [m, n] = size(A); storA = m * n; storAk = (m * k) + k + (n * k); space = storAk * 100 / storA;