A totally lost student :)

3 ビュー (過去 30 日間)
Oskar
Oskar 2020 年 9 月 8 日
回答済み: Steven Lord 2020 年 9 月 8 日
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 日
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 日
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])

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by