i want to write code for a question
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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 个评论
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 Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!