For this question, my graph didn't appear anything... Can anyone help me to solve this problem??
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Muhammad Huzayl Rais
il 13 Dic 2022
Commentato: Sam Chak
il 13 Dic 2022
Here's my code:
function myf(x)
for x= [-10 -7 0 2.4 5 6 10]
f= (5.*x.^3 + 15.*x.^2 + x + 10).*sin(x)
y=f^-1
x1= x - f/y
end
z=plot(x1,f)
end
0 Commenti
Risposta accettata
Sam Chak
il 13 Dic 2022
Modificato: Sam Chak
il 13 Dic 2022
If you want to plot the function over a region , then you can try something like this.
x = linspace(-10, 10, 1001);
y = myf(x);
plot(x, y), grid on, xlabel('x'), ylabel('f(x)')
% Setup your math function
function y = myf(x)
y = (5*x.^3 + 15*x.^2 + x + 10).*sin(x);
end
2 Commenti
Sam Chak
il 13 Dic 2022
Thought your original problem is about making the graph "appears".
Can you lookup the MATLAB code for Newton's Method (on Google) and post it here?
It makes troubleshooting your problem easy for you and me.
Just make sure you edit the Newton's code to fit your mathematical problem.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Interpolation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!