How do you declare structures within classes?
Afficher commentaires plus anciens
I want to nest a class inside of a class or a struct inside of a class:
classdef class1
properties
Commands = struct(...
'functionResetTime' ,1,...
'CtrlTestData' ,9 ...
)
x =3;
end
methods
end
end
I want to do this because I have about 20 structs that I would like to use the automatic tooltyping (. and then tab) when I write code. Kind of like .net. I don't want to have to create a file for each of these structs or import them. The method describe above doesn't work and you can't just declare a struct anymore (why? I don't know).
Réponses (2)
per isakson
le 23 Jan 2015
Modifié(e) : per isakson
le 23 Jan 2015
"method describe above doesn't work"   I don't understand how you want it to work. That's might be because I don't know the .NET-behavior. However,

 
and if I instead do
class1 = class1; % which smells
 

1 commentaire
per isakson
le 26 Jan 2015
This example is done with R2013b.
Steven
le 26 Jan 2015
0 votes
Catégories
En savoir plus sur Classes dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!