It is possible to auto complete the inputs to the member functions of the user defined class. I am suggesting a possible workaround, which I found to be working properly.
Refer to the documentation:
To customize code suggestions and completions for your functions and classes, provide MATLABwith information about your function signatures. Function signatures describe the acceptable syntaxes and allowable data types for a function. MATLAB uses this information to display code suggestions and completions in the Editor, Live Editor, and Command Window. Define this function information in a JSON-formatted file called“functionSignatures.json.”
If you are saving your “TestClass.m” definition file at a particular location, say “myfolders” and that path is included in the MATLAB search path, create a folder named “resources” in “myfolders” and make a JSON file in the folder “resources”.
But in this case, you need to hard-code the “Names” property of “TestClass”. This is not a valid solution because every time you define a new object of “TestClass” type, you need to manually change the “Names” in the JSON file.
Therefore, I have created a member function named “json_update” that will automatically create a JSON file in a “resources” folder. This function is placed inside the “constructor” of “TestClass”. Therefore, the JSON file is updated automatically with the newly allocated value of “Names” properties. I have attached “TestClass.m” file with this answer. I am also attaching the JSON file generated by the below given code. (Here I am attaching .txt file as .json is not supported here)
NOTE: Place the TestClass.m file on the search path of MATLAB. The "constructor" of "TestClass" will automatically create a "resources" folder on that path. It will also create a file named "functionSignatures.json" inside "resources" folder. You can verify this by locating the newly created "resources" folder in the current MATLAB search path.
I have executed the code in live script and got the following results:
You can see that we are getting autocomplete as expected by you.
Now, if you manually change the “Names” property as shown below figure, you will need to call “json_update( )” function manually to update the JSON as demonstrated below. This is because, the constructor is not called and that is why we need to manually call the function “json_update( )”
We can conclude that it is working satisfactorily.
Now, try to define second object of “TestClass” and name it as “B”. We can see that the auto-complete is working on second object also, thus meeting the requirements.
To understand the working behind the code, refer to the following resources:
I hope it helps!