MATLAB Answers

Observer
1

Matlab intellisense (auto completion) for objects of user defined classes in Script files (.m File)

Asked by Observer
on 23 Jul 2014
Latest activity Commented on by Observer
on 23 Jul 2014
I would like to know that is there a way for intellisense to work for user defined classes. If I create object of user defined class in command window that I can see the properties and method of that class by pressing the tab button in front of "Object + .". However, if I create object in a script file or function file then intellisense does not work. Do I need to enable some functionality or Matlab does not have this capability. Thanks

  0 Comments

Sign in to comment.

1 Answer

Answer by Friedrich
on 23 Jul 2014
Edited by Friedrich
on 23 Jul 2014
 Accepted Answer

Hi,
MATLAB cannot deal with that for now.
As a small trick, create an instance of your class in the base workspace and go back to writing your actual code.
So for example execute in the command window
a = serial('COM1');
And then go to your function you are writing and use "a.<Press TAB>" and you will see that autocompletion works.
In the case you cannot create an instance of your class use .empty this will also work fine:
a = YOURCLASS.empty(1,0);

  1 Comment

Sign in to comment.