Auto complete inputs of method using object property
Ältere Kommentare anzeigen
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 Kommentar
Shivam Gothi
am 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:
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu JSON Format finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


