problem using command solve?!
1 view (last 30 days)
Show older comments
Hi
I have a problem using command solve. when I write these commands on the command window, I get 4 answers for m equation.
ka=2;
landa=4;
syms x
y = (ka/landa)*((x/landa)^(ka-1))* (2^(-(x/landa)^ka));
LO = diff(y);
sf=solve(LO,x)
but when i use these same codes in my m.file I have get errors regarding mupad. Moreover I can access to the first answer of sf, not all of them.
Does anybody why this happen?
tnx
sasi
0 Comments
Answers (1)
Friedrich
on 14 Feb 2012
Hi,
when I run your code from the command window I get two solutions:
ka=2;
landa=4;
syms x
y = (ka/landa)*((x/landa)^(ka-1))* (2^(-(x/landa)^ka));
LO = diff(y);
sf=solve(LO,x)
sf =
(2*2^(1/2))/log(2)^(1/2)
-(2*2^(1/2))/log(2)^(1/2)
Running it in a script or functions works fine too. What error do you get? Which version of MATLAB are you using?
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!