Giving an input to a function and still having a function

3 次查看(过去 30 天)
Hi all.
My question is this. Say i have a function:
f = function(a,b) ;
How do i give the input b to the function while still having a function of a:
f = function(a).
Thanks for any help. I would be very thankful for a code example.

采纳的回答

John D'Errico
John D'Errico 2011-3-26
Easy, peasy, lemon squeezy.
b = 3.1514925635;
fun = @(a) f(a,b);
By the way, I don't believe you could actually name a function "function", a reserved word in MATLAB.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by