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

 Réponse acceptée

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

2 commentaires

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)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Geology dans Centre d'aide et File Exchange

Produits

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by