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

14 vues (au cours des 30 derniers jours)
Amy Feng
Amy Feng le 16 Avr 2019
Modifié(e) : Amy Feng le 16 Avr 2019
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.

Réponses (0)

Catégories

En savoir plus sur Vector Fields dans Help Center et File Exchange

Produits


Version

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by