why putting a variable in a matrix divide it?

When I try to put a variable in the matrix the matrix devide it self into two matrix and I want to be one
please help

1 件のコメント

Ali
Ali 2023 年 12 月 18 日
I want it to be 2 by 2 matrix

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

回答 (1 件)

Matt J
Matt J 2023 年 12 月 18 日
編集済み: Matt J 2023 年 12 月 18 日

0 投票

It is a 2x2 matrix, even though you might not like how it gets rendered in the Command Window. If it were not really a 2x2 matrix, I would not be able to do matrix operations with it, like below.
syms x
M=[1 x; 0 1]
M = 
M^2
ans = 

1 件のコメント

Matt J
Matt J 2023 年 12 月 18 日
If you want better rendering of symbolic matrices, work in LiveScript, rather than the Command Window.

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

カテゴリ

質問済み:

Ali
2023 年 12 月 18 日

コメント済み:

2023 年 12 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by