how to Invert a matrix and how to delete a row and a column?

2 ビュー (過去 30 日間)
arian hoseini
arian hoseini 2022 年 1 月 9 日
コメント済み: arian hoseini 2022 年 1 月 9 日
1.4286 5.0000 Inf 5.0000 3.3333 Inf
5.0000 0.9524 4.0000 10.0000 3.3333 5.0000
Inf 4.0000 1.6393 Inf 3.8462 10.0000
5.0000 10.0000 Inf 1.4286 2.5000 Inf
3.3333 3.3333 3.8462 2.5000 0.6410 3.3333
Inf 5.0000 10.0000 Inf 3.3333 1.6667
I have this matrix but since it contains inf variable i cant invert the matrix....and i get this NaN .....(can i replace inf with zero?)
and how can i delete specific column and row?....

採用された回答

John D'Errico
John D'Errico 2022 年 1 月 9 日
You would need to delete almost every row and column. What does it mean to invert a matrix of arbittraily small size then?
And replacing inf with zero is totally inconsistent with what that element was originally, so just repacing infs with zero and still computing an inverse seems wrong. An inf is a immensely large number, as opposed to a really tiny number.
Can you replace an inf with zero? Well, trivially, yes. Read the help for isinf to learn how to locate inf elements.
help isinf
ISINF True for infinite elements. ISINF(X) returns an array that contains 1's where the elements of X are +Inf or -Inf and 0's where they are not. For example, ISINF([pi NaN Inf -Inf]) is [0 0 1 1]. See also ISFINITE, ISNAN. Documentation for isinf doc isinf Other functions named isinf calendarDuration/isinf dlarray/isinf iddata/isinf codistributed/isinf duration/isinf sym/isinf datetime/isinf gpuArray/isinf
Can you delete a row or column of a matrix again, trivially easy. (Should you be reading one of the many MATLAB turorials to be found? Reading the manual is a good thing. Even real men do it.)
A = magic(3)
A = 3×3
8 1 6 3 5 7 4 9 2
A(2,:) = []
A = 2×3
8 1 6 4 9 2
  1 件のコメント
arian hoseini
arian hoseini 2022 年 1 月 9 日
so since im not a "real man" thank u.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by