Why does my if statement do the opposite?
Mostra commenti meno recenti
My if statement is asking that if h is negative, you must do that operation if not the other but do the opposite, do not I understand?
t=b4
e=b3
f=b2
h=e^2-4*t*f
if h==-h
qc=3
p=(h)*(-1)
x5=(sqrt(h))/(2*t);
x6=(-e/(2*t));
x7=(-sqrt(h))/(2*t);
x8=(-h/(2*t));
else
qd=4
x5=(-e+sqrt(h))/(2*t);
x6=(-e-sqrt(h))/(2*t);
end
1 Commento
Erwin Avendaño
il 8 Nov 2017
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Results, Reporting, and Test File Management in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
