How to call member function of class in another m file in matlab?

11 visualizaciones (últimos 30 días)
foozhan
foozhan el 7 de Ag. de 2014
Respondida: Adam el 7 de Ag. de 2014
How can call class function,and initialize object of class in another file.m , when calling from command window its work but I wanna call function from m file.
i have folder:@myClassName.

Respuestas (1)

Adam
Adam el 7 de Ag. de 2014
You should be able to do this just the same in an m-file as on the command line. Simply as
myObj = myClassName( args );
myObj.someFunc( otherArgs );
I haven't used the folder structure for defining a class myself, just all in one file, but I'm not aware of any reason why standard class creation and function calling don't work with the folder structure. Maybe I am missing something in your question?

Categorías

Más información sobre Software Development Tools en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by