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!