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

 Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 7 Mär. 2012
please read here
eg
>> f = @(x)x.^2-3
f(54)
f =
@(x)x.^2-3
ans =
2913

2 Kommentare

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)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Geology finden Sie in Hilfe-Center und File Exchange

Produkte

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by