How to get z for different x
Mostrar comentarios más antiguos
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 comentarios
Thomas
el 18 de Dic. de 2012
what error are you getting? what answer do you expect?
Respuesta aceptada
Más respuestas (2)
Thomas
el 18 de Dic. de 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
Daniel Shub
el 18 de Dic. de 2012
0 votos
Presumably you want to use ./ instead of /, just like you are using .* instead of *
Categorías
Más información sobre Linear Algebra en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!