Symbolic Matrix has extra blank row
古いコメントを表示
When I do this:
>> syms b
>> C = [1 b; b 2]
C =
[1 b]
[ ]
[b 2]
The online example doesn't show this but I always get a blank row. What am I doing wrong? With all numbers, I get an ordinary matrix.
回答 (2 件)
madhan ravi
2018 年 9 月 4 日
編集済み: madhan ravi
2018 年 9 月 4 日
OR TRY:
C = str2sym('[1 b; b 2]')
Edited after Sir walter‘s comment.
10 件のコメント
madhan ravi
2018 年 9 月 4 日
I tried your code and it works fine for me.
madhan ravi
2018 年 9 月 4 日
if something is not clear let me know
madhan ravi
2018 年 9 月 4 日
Install symbolic toolbox.
madhan ravi
2018 年 9 月 4 日
Type ver in your command window and paste what shows here.
Walter Roberson
2018 年 9 月 4 日
The above would not work in R2018a or later.
madhan ravi
2018 年 9 月 4 日
Oh that’s useful information @sir Walter thank you.
Walter Roberson
2018 年 9 月 4 日
MATLAB warned for a number of releases about using sym() of anything that was not numeric or just the name of a variable. In R2017b, they finally provided str2sym() to convert expressions to symbolic. In R2018a, they disabled using sym() on expressions.
>> C = str2sym('[1 b; b 2]')
C =
[ 1, b]
[ b, 2]
madhan ravi
2018 年 9 月 4 日
That’s really useful information @sir Walter.
madhan ravi
2018 年 9 月 4 日
did it work @Carol Hurwitz?
madhan ravi
2018 年 9 月 5 日
編集済み: madhan ravi
2018 年 9 月 5 日
If you find our (me and sir Walter‘s) answer useful please do accept my answer.
Carol Hurwitz
2018 年 9 月 4 日
0 投票
2 件のコメント
Carol Hurwitz
2018 年 9 月 5 日
編集済み: Walter Roberson
2018 年 9 月 5 日
Walter Roberson
2018 年 9 月 5 日
Is it possible that you have Maple installed on the system that has the problem?
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!