I have been trying to solve a problem for a while now on MATLAB but am not coming anywhere. I have made a graph that i think is good but if you compare it to solution and my graph they are not the same. The question is;
It is often quite difficult to determine the range of a function exactly. Use a graphing utility (calculator or computer) to graph the function f, and by zooming in on the graph, determine the range of f with accuracy of 2 decimal places.
f(x)= (x-1)/(x^2+x)
my code:
>> f=@(x) (x-1)./(x.^2+x);
>> x=-25:0.1:25;
>> y=f(x);
>> plot(x,y)
please help and tell my why my graph is not the same as the solution.

 채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2020년 9월 8일

0 개 추천

Hi,
Here is the corrected solution to your exercise.
f=@(x) (x-1)./(x.^2+x);
x=[-25:0.1:-1, 0:.1:25;]; y=f(x); plot(x,y), grid on, shg

추가 답변 (1개)

Steven Lord
Steven Lord 2020년 9월 8일

0 개 추천

The limits of the axes in your figure are different from the limits of the axes pictured in your textbook. Try changing the axes limits to better match those of the axes in your book and the two should look a lot more similar.
xlim([-5 5])
ylim([-7 1])

카테고리

도움말 센터File Exchange에서 Graphics Objects에 대해 자세히 알아보기

태그

질문:

2020년 9월 8일

답변:

2020년 9월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by