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

I have seen this before but I can't remember. Can someone give an example? Thanks.

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 3월 7일
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에서 Geology에 대해 자세히 알아보기

제품

태그

질문:

2012년 3월 7일

댓글:

2020년 7월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by