problem with Solve-function
Afficher commentaires plus anciens
>> solve('k=0.3*(y1*y2)* (k^psi + y2) ^ ((1-psi)/psi)','k') Warning: Explicit solution could not be found. > In solve at 83
ans =
[ empty sym ]
>> psi
psi =
-0.6667
>> y2
y2 =
0.6667
>> y1
y1 =
215.1657
>> solve('k=0.3*( 215.1657*0.6667)* (k^(-0.6667) + 0.6667) ^ ( (1-(-0.6667)) /(-0.6667) )','k')
ans =
100.23898600309546274125023175854
So why can't the solve function find this solution???
Réponses (1)
Walter Roberson
le 7 Mai 2012
The argument you sent to solve() was a quoted string. When you pass a quoted string, the value of any MATLAB variables is not used.
solve(subs(sym('k=0.3*(y1*y2)* (k^psi + y2) ^ ((1-psi)/psi)')),'k')
or
syms k
solve(0.3*(y1*y2)* (k^psi + y2) ^ ((1-psi)/psi) - k, k)
Catégories
En savoir plus sur Symbolic Math Toolbox 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!