For this question, my graph didn't appear anything... Can anyone help me to solve this problem??

조회 수: 2 (최근 30일)
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

채택된 답변

Sam Chak
Sam Chak 2022년 12월 13일
편집: Sam Chak 2022년 12월 13일
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
Muhammad Huzayl Rais
Muhammad Huzayl Rais 2022년 12월 13일
Hi, sir thanks for helping me, but I still couldn't understand this 'Use Newton's Method to find the solution to the equation below to the accuracy of 10−7. '
Sam Chak
Sam Chak 2022년 12월 13일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by