After normalizing vectors, slope field graph does not look normalized. Help.

조회 수: 14 (최근 30일)
Amy Feng
Amy Feng 2019년 4월 16일
편집: Amy Feng 2019년 4월 16일
I am trying to normalize the slope field to get a nice looking graph. However, I am not sure what I am doing wrong because I thought that I normalized the vectors. I must have a small mistake somewhere, but I am not sure where. I have attached a mat file with the values that I am using.
Here is the code:
function slope(aR,bR,aF,bF,y0,a_x,b_x,a_y,b_y,h_x,h_y,M)
r=a_x:h_x:b_x;
f=a_y:h_y:b_y;
[R,F] = meshgrid(r,f);
dr = aR.*R.*(1-(R./M))-bR.*R.*F;
df = aF.*R.*F-bF.*F;
d = sqrt( dr.^2 + df.^2 );
pr = dr./(d+0.0001);
pf = df./(d+0.0001);
quiver(R,F,pr,pf,0.5,'Color','k','ShowArrowHead','off');
axis tight;
axis([a_x b_x a_y b_y])
Here is the image of the slope field:
Thank you so much for your help in advance.

답변 (0개)

카테고리

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

제품


릴리스

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by