Filter löschen
Filter löschen

Giving an input to a function and still having a function

3 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

John D'Errico
John D'Errico am 26 Mär. 2011
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.

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by