Giving an input to a function and still having a function

조회 수: 6 (최근 30일)
Mads Svendsen-Tune
Mads Svendsen-Tune 2011년 3월 26일
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에서 Octave에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by