Ubuntu 管理心得

搜尋此網誌

2023年8月13日 星期日

Octave multiple arguments for function handle

Suppose myfunc.m is:
 
function y=myfunc(x,a,b)
y=x+a+b;
endfunction


Use the command for example:

quad( @(x) myfunc (x, 1, 2),0,1) 

It outputs the quad integraion of myfunc from 0 to 1 with the argument a=1, b=2.