Your input matrix probably contains infinity or not a number(NaN). Set a breakpoint in your file then run it again. When MATLAB reaches the breakpoint, look at the input matrix values. It will contain at least one element that is Inf, NaN, or -Inf. The SVD function doesn't know how to compute the singular value decomposition of a matrix with a nonfinite element. If you are updating matrix in a loop, the first iteration may not be the one that's throwing the error; in that case, or once you've determined that input matrix does actually contain a nonfinite value, set an error breakpoint to stop as soon as an Inf or NaN value is created. This will indicate where the nonfinite element of X is being introduced. Then figure out, based on your knowledge of your algorithm, how to prevent the nonfinite value from being introduced.
Hope this helps!
Best Answer