I have two matrices A1 and A2 in HDF format. I use the following code to import them.
A1 = Import[
"http://www.math.mtu.edu/~struther/Courses/4610/Data/A1.hdf", "Data"];`
When I type Dimensions[A1]
I get the output
{1, 12, 10}
Now, I want to do the Singular Value Decomposition on A1
and reconstruct it from the output matrices.
I can do the SVD, but when I check the original and reconstructed matrix by inputting A1 - U.W.Transpose[V]
, I get a shape not matching error. Also, when I see A1
in MatrixForm
, I see a matrix with each column as a separate vector(column matrix) inside the big matrix.
{U, W, V} = SingularValueDecomposition[A1];
Norm[A11 - U.W.Transpose[V], 2]
Here's a screenshot of A1 in MatrixForm
I can't figure out why there are separate columns inside the matrix. Also there are 10 rows and 12 columns, but Dimensions[A1]
outputs
{1, 12, 10}
Any help would be greatly appreciated.