When calling a function or indexing a variable, use parentheses.
1 回表示 (過去 30 日間)
古いコメントを表示
Hello I am trying to solve this but I need some help to make it work. Kinda new working around matlab. your help would be totally appreciated. Thank you.
0 件のコメント
回答 (2 件)
DGM
2023 年 11 月 20 日
The error message tells you what to do. diag() is a function; [1 2 3] is a vector, so:
diag([1 2 3])
0 件のコメント
Walter Roberson
2023 年 11 月 20 日
The syntax for calling functions is function name followed by ( followed by a list of parameters followed by )
You are trying to use diag[Expressions] -- which would be the kind of calling syntax that Mathematica would use, but not MATLAB.
Use diag([Expressions]) instead.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!