How to find a real positive root
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How to find only the positive root of the equation x^3-A=0 for each A where A is a parameter varying like 1,2,3,....1000.
If alpha is the root, find the value of alpha/(alpha +1) for each case.
0 commentaires
Réponse acceptée
Youssef Khmou
le 15 Avr 2013
Modifié(e) : Youssef Khmou
le 15 Avr 2013
hi, try this essay :
counter=1;
for A=1:100
f=@(x) x^3-A;
alpha=fzero(f,A);
if isa(alpha,'complex');
continue;
else
X(counter)=alpha;
Y(counter)=alpha/(alpha+1);
counter=counter+1;
end
end
figure, plot(Y);
2 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!