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
댓글 수: 0
채택된 답변
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
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 Center 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!