How to get z for different x
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
x = [-2:0.1:2];
z=x.*(1-x).*(2-x).*(4-x)/((6-x)-(1-x).*(x-7));
I am getting error. Please correct my problem.
2 commentaires
Réponse acceptée
Wayne King
le 18 Déc 2012
Modifié(e) : Wayne King
le 18 Déc 2012
x = [-2:0.1:2];
z = x.*(1-x).*(2-x)./((6-x).*(x-7));
You just forgot a ./
Now you should have a vector
x = [-2:0.1:2];
z = x.*(1-x).*(2-x)./((6-x).*(x-7));
plot(x,z)
Plus de réponses (2)
Thomas
le 18 Déc 2012
x = [-2:0.1:2];
z=x.*(1-x).*(2-x).*(4-x)./((6-x)-(1-x).*(x-7))
You missed the . before the division to do element by element division
0 commentaires
Daniel Shub
le 18 Déc 2012
Presumably you want to use ./ instead of /, just like you are using .* instead of *
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!