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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -