MATLAB Answers

Using costant value to Anonymous function

1 view (last 30 days)
ELISABETTA COCCIA
ELISABETTA COCCIA on 24 Oct 2019
How can I write an anonymous function calling back a costant value?

  0 Comments

Sign in to comment.

Answers (1)

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi on 30 Oct 2019
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 Comments

Sign in to comment.

Sign in to answer this question.