problem using command solve?!
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Friedrich
le 14 Fév 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?
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!