evaluate expression
Afficher commentaires plus anciens
I have equation y=x*exp( (1-y)/(A*y)*B ) where A nd B constants in my program. I have a vector values for x. How can I evaluate y to plot y versus x ?
Réponse acceptée
Plus de réponses (1)
Andrew Newell
le 12 Mai 2011
It would be simpler to provide y and solve for x:
y = -1:0.01:1;
x = y.*exp(- (1-y)./(A*y)*B );
In plotting this, you have to be careful because x goes to Inf or -Inf as y approaches zero from below:
I = y < 0 & abs(x) < 10;
plot(x(I),y(I))
hold on
I = y > 0 & abs(x) < 10;
plot(x(I),y(I))
1 commentaire
omnia
le 13 Mai 2011
Catégories
En savoir plus sur Annotations dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!