Why is my graph stopping at 10?

조회 수: 3 (최근 30일)
Krish Desai
Krish Desai 2016년 2월 16일
댓글: KSSV 2016년 2월 16일
So I'm graphing the following (note: I'm also graphing a direction field) and when I plot it the graph stops when x=10. Any suggestions?
fishfun = @(y) (1.2*y.^2)/1+y.^2;
y=linspace(0,10,200);
%(1.2*y.^2)./(1+y.^2); %we generated TWO vectors 1.2y^2 and 1+y^2. To get
%the quotient, we need to divide COMPONENT WISE.
plot(y,(.65*y)-(0.65*y.^2/10.5));
title('Graph of Rainbow Trout')
ylabel('Amount of fish (hundreds)')
xlabel('Time (days)')
hold on
f= @ (t,y) (.65*y)-(0.65*y.^2/10.5)-(((1.2*(y^2))/(1+(y^2))));
dirfield(f,0:1:30, 0:.05:2)
title 'Direction Field of Rainbow Trout'
  댓글 수: 1
KSSV
KSSV 2016년 2월 16일
what is dirfield? Code can be checked if dirfield is known.

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

채택된 답변

the cyclist
the cyclist 2016년 2월 16일
편집: the cyclist 2016년 2월 16일
In the first plot, it's because in this line:
y=linspace(0,10,200);
you define that y ranges from 0 to 10.
I can't run dirfield, so I'm not sure about the second plot.
  댓글 수: 1
Krish Desai
Krish Desai 2016년 2월 16일
Second plot is the exact same problem, thanks!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by