Prev: Eigen face to plot with image?
Next: Getting indexes of rows of matrix with more than n repetitions
From: Shiyuan Gu on 4 Jan 2010 21:14 Hello, I have a function, say f1(x,y,z); I want to create a function handle pointing to the function f2(x)=f1(x,yC,zC) where yC,zC are fixed and given at run-time. I try fh=(a)f1(x,yC,zC) and it does not work. How can I do that? Thank you.
From: Steven Lord on 4 Jan 2010 21:33 "Shiyuan Gu" <gshy2014(a)gmail.com> wrote in message news:hhu79c$e43$1(a)fred.mathworks.com... > Hello, I have a function, say f1(x,y,z); I want to create a function > handle pointing to the function f2(x)=f1(x,yC,zC) where yC,zC are fixed > and given at run-time. I try fh=(a)f1(x,yC,zC) and it does not work. How can > I do that? If you're using MATLAB 7.0 (R14) or later, use an anonymous function. yC = 1; zC = 2; fh = @(x) f1(x, yC, zC) -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
|
Pages: 1 Prev: Eigen face to plot with image? Next: Getting indexes of rows of matrix with more than n repetitions |