Sync
This commit is contained in:
parent
6f050a029e
commit
776bba907c
3887 changed files with 59894 additions and 7280 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 refered 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