Auto complete inputs of method using object property
Show older comments
Hey,
I have a class with a property that I would like to use for auto completion:
classdef TestClass
properties
Names
end
methods
function self = TestClass(names)
arguments
names (1,:) string
end
self.Names = names;
end
function printName(self, name)
mustBeMember(name, self.Names)
disp(name)
end
end
end
So when I call the method 'printName', I would like matlab so suggest the possible options, i.e. the elements of the property 'Names'.
How can I do that?
1 Comment
Shivam Gothi
on 17 Sep 2024
you can achieve the objecive by JSON-formatted file called functionSignatures.json
The below given link for the documentation explains in detail about it:
Additionally you may refer to the MATLAB answers link:
To validate your "functionSignatures.json" files you can use command "validateFunctionSignaturesJSON". Refer to the below documentation for more help:
Accepted Answer
More Answers (0)
Categories
Find more on JSON Format in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

