how can I use my function f to replace a and b with writing all the equation every time? x^3 + a^2*x^2 - 10)*sin(x) - y) like f(a)*f(b)<0
3 次查看(过去 30 天)
显示 更早的评论
clc;
clear;
syms p;
x = 13.61015;
y = 13257;
a = 5.14;
b = 11.47;
err1 = 0.000001;
f = (x^3 + p^2*x^2 - 10)*sin(x) - y == 0;
i=0;
if ((x^3 + a^2*x^2 - 10)*sin(x) - y) * ((x^3 + b^2*x^2 - 10)*sin(x) - y) > 0
disp ('Wrong Interval');
return
end
0 个评论
采纳的回答
Torsten
2022-10-31
x = 13.61015;
y = 13257;
a = 5.14;
b = 11.47;
err1 = 0.000001;
f = @(x,y,p) (x^3 + p^2*x^2 - 10)*sin(x) - y ;
f(x,y,a)
f(x,y,b)
2 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!