Auto complete inputs of method using object property
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?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? 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? oop, class MATLAB Answers — New Questions