problem with multiplying a matrix with a vector

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 件のコメント

Stephen23
Stephen23 2021 年 1 月 5 日
編集済み: Stephen23 2021 年 1 月 5 日
"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)
Warning: Matrix is singular to working precision.
ans = 2×2
Inf Inf Inf Inf
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
Ömer Altas 2021 年 1 月 5 日
oh ok thanks. i have not seen that

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2021 年 1 月 5 日

編集済み:

2021 年 1 月 5 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by