フィルターのクリア

i want to write code for a question

2 ビュー (過去 30 日間)
rakesh kumar
rakesh kumar 2020 年 9 月 27 日
コメント済み: Ameer Hamza 2020 年 9 月 27 日
c=0.1(x-y)
x=4:0.01:12
y=sqrt(c/2)
i have to find the value of x for which c=.0038416

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 9 月 27 日
編集済み: Ameer Hamza 2020 年 9 月 27 日
Although this equation is linear is x, and you can write the equation of x. For a general case, you can use fsolve()
c = 0.0038416;
f = @(x) c - 0.1*(x-sqrt(c/2));
x = fsolve(f, 0);
If you have the symbolic toolbox
syms x
c = 0.0038416;
eq = c == 0.1*(x-sqrt(c/2));
x = double(solve(eq))
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 9 月 27 日
I think you missed the sqrt() in the symbolic part?
Ameer Hamza
Ameer Hamza 2020 年 9 月 27 日
Thanks for pointing out. OP kept changing the question initially, so I forgot to make the change in the symbolic part.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by