problem with multiplying a matrix with a vector
Show older comments
Hi Matlab Community,
i have a problem with my matlab script. M is a matrix and R is a vector. i cant see the problem right now. also in the workspace there is a NaN shown for C. Hope you can help me.
2 Comments
"problem with multiplying a matrix with a vector"
The problem is that you are trying to create the inverse of a (nearly) singular matrix:
[0,0;0,1]^(-1)
In any case, solving for C using the matrix inverse is not recommended, the more efficient and more accurate method is to use mldivide, exactly as the inv documentation explains:
SOL.C = SOL.M\SOL.R
Of course that will not get rid of your singular matrix, so you will still need to fix that.
Ömer Altas
on 5 Jan 2021
Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!