Looking for a way to mask handle functions when calling methods or doc
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi
I'm putting together an object-oriented program that I want others to use. Most of the classes I use derive from handles, which is all good and well except that calling
help MyClass
also displays all the handle functions (eq, delete, addListener etc.). I want to hide these to help people learning to use the program, and to keep the tab-completion menu short and snappy.
I found a work-around solution from 2008 here: http://www.tim.cz/en/nfaq/matlab-simulink/tab-completion.php
Which involves overwriting the default methods() function. Before I commit to making sense of the approach in the link, has a more elegant means of this been implemented since 2008? (We've got R2010a at my university)
Cheers
댓글 수: 0
채택된 답변
Oleg Komarov
2012년 9월 10일
편집: Oleg Komarov
2012년 9월 11일
EDITED
classdef foo < handle
properties
a = [];
b = [];
end
methods
function obj = foo
end
function methodA(obj)
obj.a = 1;
end
end
methods (Hidden)
function methodB(obj)
obj.b = 2;
end
function addlistener(obj, property, eventname, callback)
addlistener@addlistener(obj, property, eventname, callback)
end
end
end
a = foo;
methods(a)
댓글 수: 6
Oleg Komarov
2012년 9월 13일
You could actually submit an enhancement request to the technical support.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!