Using costant value to Anonymous function
조회 수: 13 (최근 30일)
이전 댓글 표시
How can I write an anonymous function calling back a costant value?
댓글 수: 0
답변 (1개)
Sahithi Kanumarlapudi
2019년 10월 30일
Assuming by ‘calling back a constant value’ you mean that the anonymous function returns a constant value the following code is an example
s = @(x) 5; % anonymous function
Now if you run
a(23)
Output is
5
Hope this helps!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!