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

 Risposta accettata

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

2 Commenti

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)

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Geology in Centro assistenza e File Exchange

Prodotti

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by