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

 采纳的回答

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

2 个评论

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)

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品

标签

Community Treasure Hunt

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

Start Hunting!

Translated by