how to define a function in the command window using "@"

 Respuesta aceptada

please read here
eg
>> f = @(x)x.^2-3
f(54)
f =
@(x)x.^2-3
ans =
2913

2 comentarios

Can this be done (@x) sin(x)-exp(-x)
Moving the first left parenthesis to its proper place, sure.
f = @(x) sin(x)-exp(-x);
f(-1:0.25:1)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Geology en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 7 de Mzo. de 2012

Comentada:

el 1 de Jul. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by