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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Vector Fields 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!