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

14 次查看(过去 30 天)
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