give private access to a figure in a class
2 次查看(过去 30 天)
显示 更早的评论
Hello I am building a class that accesses a figure and than manipulates the data of the figure. My problem is that a plot outside of my figure could destroy all the data of the figure.
the class definition:
classdef theVectorscope < handle
properties(access=protected)
thefig
theaxis
pltlist
end
methods
%-----------DRAW-----------k
function obj = Myspecialfigure()
obj.thefig = figure();%Create a figure
obj.theaxis = axes('Position', [0.1, 0.1, .8, .8],'Parent',obj.thefig);
obj.pltlist = plot(rand(1,5,rand(1,5)),'Parent',obj.theaxis)%Making a simple plot
set(obj.thefig ,'HitTest','off')
end
end
I tryed protected but the figure can still be manipulated outside of my class. Is it possible to make a protected figure with matlab classes ?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!