can anyone provide more example? i dont understand this from the doc

 채택된 답변

Mischa Kim
Mischa Kim 2015년 3월 23일
편집: Mischa Kim 2015년 3월 23일

0 개 추천

Victor, does this help?
fh = @(x,y) x.*y.^2;
fh(3,2)
ans =
12
The example above shows a function handle for an anonymous function.
What exactly are you trying to do?

댓글 수: 3

Victor Seaw
Victor Seaw 2015년 3월 23일
편집: per isakson 2015년 3월 23일
im trying to know how to apply @ in my working oh so meaning fh = @(x,y) x.*y.^2; where x.*y.^2 has to be in the same row with fh? if i used it in this way:
fh=@(x,y)
|x.*y.^2|
it wont work?
Star Strider
Star Strider 2015년 3월 23일
편집: Star Strider 2015년 3월 23일
They generally have to be on the same line. However, you can use the ellipsis (...) as a continuation to the next line. There cannot be any blank lines after lines ending in ....
See the documentation for Special Characters for details. (It’s about half-way down the page.)
Victor Seaw
Victor Seaw 2015년 3월 24일
Thx

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

질문:

2015년 3월 23일

댓글:

2015년 3월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by