how do you multiply f(-1)*f(0) in matlab?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Britney
el 7 de Oct. de 2014
Comentada: Britney
el 7 de Oct. de 2014
Hey guys,
Annoying problem...but I'm new to matlab.
I have a function f=@(x)(x-2.5).*exp(-0.5)*(x-2).^2)+0.2. I want to calculate f(-1)*f(0). How do you do it?
I need to specify a bit. I'm confused on how to calculate f(x) for any number I want. Like, if I want the answer of f(8) of the equation how do I compute it in matlab?
0 comentarios
Respuesta aceptada
Image Analyst
el 7 de Oct. de 2014
Try it this way:
workspace; % Make sure workspace panel is showing.
% Define function
f=@(x)(x-2.5).*exp(-0.5*(x-2).^2)+0.2
% Compute some results
r1 = f(8)
r2 = f(-1)
r3 = f(0)
r4 = r2 * r3
6 comentarios
Image Analyst
el 7 de Oct. de 2014
Britney, I think our answers crossed and you got it working now. So please mark the answer as Accepted if we're done.
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!