How to add a constant to a symbolic array element by element?

1 回表示 (過去 30 日間)
Leigh Harrison
Leigh Harrison 2020 年 3 月 21 日
コメント済み: madhan ravi 2020 年 3 月 21 日
My code is as follows
Mr_theo = (W_R + Up)./a2;
where W_R is a 1x1 double, Up is a 100x1 symbolic array, and a2 is a 100x1 symbolic array. All numbers are positve, however, they consistently are yeilding a negative number, which makes no sense to me at all. Is this a syntax error? the addition of W_R and Up is causing matmatical errors.
  4 件のコメント
madhan ravi
madhan ravi 2020 年 3 月 21 日
save VARiables.mat W_R Up a2
Leigh Harrison
Leigh Harrison 2020 年 3 月 21 日
thank you!

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

回答 (1 件)

madhan ravi
madhan ravi 2020 年 3 月 21 日
They are not negative numbers but probably represented in scientific notations.
format longg % at the beginning
Because the answers I get is all positive.
  2 件のコメント
Leigh Harrison
Leigh Harrison 2020 年 3 月 21 日
So when I run the same formula in a new script all my numbers work, but when I run the script all together (even in a new m file), it outputs the incorrect negative stuff. This really confuses me - the format longg did not change it. Any more ideas?
madhan ravi
madhan ravi 2020 年 3 月 21 日
could you share your result as .mat file?

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by