problem with Solve-function
Show older comments
>> 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???
Answers (1)
Walter Roberson
on 7 May 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)
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!