how to use the mathmatical constant "e" in conjunction with a vector.
Mostrar comentarios más antiguos
I am trying to use the mathmatical constant "e" in conjunction with a vector and each time i rum my script i tells me that the " * " is wrong. I have narrowed it down by removign things one piece at a time and everything runs great until i add the e back into my script. i saw somewhere that you can use exp() to make it work but in conjunction with the rest of the function i am not getiing it to work.
1 comentario
SonOfAFather
el 29 de Ag. de 2012
Respuesta aceptada
Más respuestas (1)
Wayne King
el 29 de Ag. de 2012
Editada: Wayne King
el 29 de Ag. de 2012
You need to post some code so we can see where you encounter an error. You can certainly use exp() with vectors.
x = 1:0.001:10;
y = exp(x);
% or
z = exp(1)*ones(100,1);
Of course, you can always define a variable.
e = exp(1);
but I don't think you should need to do that.
Also, don't forget the "dot" notation if that is necessary.
x = 1:0.001:10;
y = exp(-x.^2);
plot(x,y)
1 comentario
SonOfAFather
el 29 de Ag. de 2012
Categorías
Más información sobre Data Type Conversion 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!