Disable solve function warnings

6 ビュー (過去 30 日間)
Hassan Alhobail
Hassan Alhobail 2018 年 3 月 9 日
コメント済み: Hassan Alhobail 2018 年 3 月 9 日
I'm using the solve function in my program and every time I run it I get I get this whole text of warnings:
Warning: Support of character vectors that are not valid variable names or define a number will be removed in a
future release. To create symbolic expressions, first create symbolic variables and then use operations on them.
...
This is my program:
e1 = 'v1 = (10+v2+v3+0)/4';
e2 = 'v2 = (v1 + 10 + 0 + v4)/4';
e3 = 'v3 = (0+v1+v4+0)/4';
e4 = 'v4 = (v2+v3+0+0)/4';
s = solve(e1,e2,e3,e4);
Is there a way to simply ignore this warning in matlab?

採用された回答

Walter Roberson
Walter Roberson 2018 年 3 月 9 日
編集済み: Walter Roberson 2018 年 3 月 9 日
"Is there a way to simply ignore this warning in matlab?"
warning('off', 'symbolic:sym:sym:DeprecateExpressions')
but better is just to rewrite to follow the suggestions
syms v1 v2 v3 v4
e1 = v1 == (10+v2+v3+0)/4;
e2 = v2 == (v1 + 10 + 0 + v4)/4;
e3 = v3 == (0+v1+v4+0)/4;
e4 = v4 == (v2+v3+0+0)/4;
s = solve(e1,e2,e3,e4);
My understanding is that they are pretty serious about turning off the feature you are using.
  1 件のコメント
Hassan Alhobail
Hassan Alhobail 2018 年 3 月 9 日
Thank you. This was the method I learned, but I don't mind rewriting it with the way you suggested.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by