Error with matrix dimensions arithmetic

1 回表示 (過去 30 日間)
Charles
Charles 2024 年 2 月 18 日
編集済み: Voss 2024 年 2 月 18 日
I'm doing tutorials in Matlab for school, testing what should and shouldn't work. So when I tried subtrating a 1xn matrix from an mx1 matrix and vice versa, it resulted in an nxn matrix in both cases when it should have resulted in:
"??? Error using ==> -
Matrix dimensions must agree."
according to the tutorial.

採用された回答

Voss
Voss 2024 年 2 月 18 日
編集済み: Voss 2024 年 2 月 18 日

Sounds like the tutorial is for an older version of MATLAB, and the behavior changed since then. Here is an article related to that change.

https://blogs.mathworks.com/loren/2016/10/24/matlab-arithmetic-expands-in-r2016b/

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by