Matlab header files -
i have part of code repeated in number of matlab funcions (.m files). want put code functions can defined in single file (say commandhelper.m) , use these functions in original .m files. (just defined in header files). possible?
matlab comes full featured object model documented in object-oriented programming. may provide helper functions static methods.
classdef commandhelper methods (static) function text = firstcommand() text = 'firstcommand'; end function text = secondcommand() text = 'secondcommand'; end end end
helper functions may called command line or other function, script following syntax.
>> commandhelper.firstcommand ans = firstcommand >> commandhelper.secondcommand ans = secondcommand
Comments
Post a Comment