Variable names in fsolve
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello everyone, I am wondering whether I could use variable names in using solve, instead of x(1), x(2).... For example, imagine that x(1) is variable "output", which I name Y, x(2) is consumption which I name C and x(3) investment (I). So, in fsolve I should write:
x(1) - x(2) - x(3) ;
But is there a way I could write:
Y - C - I ;
and matlab understands what I mean?
Thanks!!
Kyriacos
0 commentaires
Réponse acceptée
Grzegorz Knor
le 25 Nov 2011
Just replace the variables:
function F = myfun(x)
Y = x(1);
C = x(2);
I = x(3);
.
.
.
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Variables dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!