matlab code for determining unknown variables

1 回表示 (過去 30 日間)
Vinay Srinivasan
Vinay Srinivasan 2019 年 10 月 6 日
コメント済み: Vinay Srinivasan 2019 年 10 月 6 日
Hello all,please help me in writing a code for this
h/c=1.87, x=110
x=h+c
how to write code for determining h and c

回答 (1 件)

Walter Roberson
Walter Roberson 2019 年 10 月 6 日
There is not just one solution, there is a family of solutions that depends upon the uncertainty in the floating point number 1.87 . In science, 1.87 represents the set of numbers that round to 1.87, so [1.87-0.005, 1.87+0.005) semi-open interval
syms h c delta
assume(-0.005 <= delta & delta < 0.005);
eqn1 = h/c == 1.87 + delta;
x = 110;
eqn2 = x == h+c;
sol = solve([eqn1, eqn2], [h, c]);
subplot(1,2,1);
fplot(sol.h, [-0.005, 0.005]);
xlabel('uncertainty in 1.87')
ylabel('h');
subplot(1,2,2);
fplot(sol.c, [-0.005, 0.005]);
xlabel('uncertainty in 1.87')
ylabel('c')
  1 件のコメント
Vinay Srinivasan
Vinay Srinivasan 2019 年 10 月 6 日
thank you so much

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by