Bastian Ebeling
Bastian Ebeling

Reputation: 1130

Constants for each instance of a matlab class

I want to save data to a constant field (different for each instance).
Think of that like a fiel with the creation date of the object.
I can not find out, how to do that. Reading Property Attributes and Properties with constant values tells me that constants can only be for the whole class (a kind of static).
Is there a solution without using a variable property (not meaning dynamic property)?

Upvotes: 0

Views: 71

Answers (1)

Cody A. Ray
Cody A. Ray

Reputation: 6027

Sounds like you're looking for an immutable property, rather than a constant.

In Java, this is basically a final attribute, whereas a constant is a like final static attribute.

Upvotes: 3

Related Questions