MATLAB program to find the roots of an equation
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mohamed Adel
el 21 de Jul. de 2018
Comentada: Mohamed Adel
el 21 de Jul. de 2018
Write a MATLAB program to find the roots of the following equation for 0.2≤C≤2 (take ∆ C=0.1). Then plot the obtained roots versus the constant C. cos(x)=C*x
That's my try and I don't know what I did wrong
2 comentarios
Steven Lord
el 21 de Jul. de 2018
This sounds like a homework assignment. If you show us what you've tried already to solve the problem and ask a specific question about where you're having difficulty we may be able to offer suggestions for how to proceed.
Respuesta aceptada
Basil C.
el 21 de Jul. de 2018
Instead of using fsolve try using vpasolve
syms x
c=0.2:0.1:2;
y=cos(x)-c*x;
for i=1:numel(y)
sol(i)=vpasolve(y(i),x);
end
Now you can continue with plotting the graph
the approximate solution of each equation is stored in the variable sol
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!