Popular Posts

Monday, May 14, 2012

Using multiple functions in single file(globally)

Declaration: 
function funs = makefuns
  funs.fun1=@fun1;
  funs.fun2=@fun2;
end

function y=fun1(x)
  ...
end

function z=fun2
  ...
end
 
 
 
Calls: 
myfuns = makefuns;
myfuns.fun1(x)    
myfuns.fun2() 

see also for object oriented programming in matlab: 
http://yagtom.googlecode.com/svn/trunk/html/objectOriented.html

No comments:

Post a Comment