Question on function handles
Show older comments
Hi
I am looking at the code for "Learning the Extended Kalman Filter" by by Yi Cao on the File Exchange. In the code , there are a couple of lines that I couldnt get:
f=@(x)[x(2);x(3);0.05*x(1)*(x(2)+x(3))]; h=@(x)x(1);
Can someone explain how handles work here? (in terms of plain math)
1 Comment
per isakson
on 20 Jun 2012
Did you read on "function handle" in the online documentation?
Accepted Answer
More Answers (1)
Walter Roberson
on 20 Jun 2012
0 votes
In terms of plain math:
A function handle is a projection of a subspace of a domain (represented by a tuple) on to a subspace of a range (represented by a tuple). The projection function is arrived at by currying the original function to creating a new function which embeds all elements of the tuple that are to be treated as constants with respect to the projection.
If you prefer, I could rephrase in terms of Denotational Semantics, but I think I packed my reference book for that.
I think you will find the use of function handles rather clearer if you think of them procedurally rather than mathematically, and examine the online MATLAB documentation on function handles.
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!