Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
18
Task/Higher-order-functions/MATLAB/higher-order-functions.m
Normal file
18
Task/Higher-order-functions/MATLAB/higher-order-functions.m
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
F1=@sin; % F1 refers to function sin()
|
||||
F2=@cos; % F2 refers to function cos()
|
||||
|
||||
% varios ways to call the referred function
|
||||
F1(pi/4)
|
||||
F2(pi/4)
|
||||
feval(@sin,pi/4)
|
||||
feval(@cos,pi/4)
|
||||
feval(F1,pi/4)
|
||||
feval(F2,pi/4)
|
||||
|
||||
% named functions, stored as strings
|
||||
feval('sin',pi/4)
|
||||
feval('cos',pi/4)
|
||||
F3 = 'sin';
|
||||
F4 = 'cos';
|
||||
feval(F3,pi/4)
|
||||
feval(F4,pi/4)
|
||||
Loading…
Add table
Add a link
Reference in a new issue