Protected External Methods
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
As a coding standard, our lab uses external methods as a way of maintaining our modular code. However, I've found that MATLAB doesn't have a way to make the Access for external methods protected. I've found that I can make external methods private by adding a /private/ folder to the class folder, so I was wondering if there was a 'protected' equivalent.
2 commentaires
Réponse acceptée
Daniel Shub
le 20 Mai 2011
http://www.mathworks.com/help/techdoc/matlab_oop/brqy3km-14.html#brqy3km-15 under "Specify Method Attributes in classdef File" ...
Basically, inside the class definition create a methods block with properties Acess = protected. Inside that block add the function footprint.
methods (Access = protected)
[a,b,c]=protectedmethod(x,y,z);
end
Then create a seperate m file in the root class directory named protectedmethod with the header
function [d,e,f]=protectedmethod(u,v,w)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Model Protection dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!