Function handle of N,x to function of x
Show older comments
I have K, which is a function handle with 2 inputs of N and x. It want to be able to put a value for N into K and get back a function (or function handle) of x.
For example, if K were x/N, I would get x back when I put in N=1, x/2 back when N=2, etc.
How do I do this?
Answers (1)
per isakson
on 22 Jan 2012
Try this:
x = 16;
K = @(N) x/N;
K(2)
If that is not what you asked for please rephrase your question.
Categories
Find more on Vehicle Dynamics Blockset in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!