Let's say I'm creating the following struct in Matlab:
spec.Property1 = 0
spec.Property2 = 0
spec.Property3.Name = 0
spec.Property3.Something = ''
It's working and I'm getting my expected struct:
Property1: 0
Property2: 0
Property3: [1×1 struct]
Let's say i want to do this:
nameOfNewStruct1 = 'Property1'
nameOfNewStruct2 = 'Property2'
nameOfNewStruct3 = 'Property3.Name'
nameOfNewStruct4 = 'Property3.Something'
spec.(nameOfNewStruct1) = 0
spec.(nameOfNewStruct2) = 0
spec.(nameOfNewStruct3) = 0
spec.(nameOfNewStruct4) = ''
Invalid field name: 'Property3.Name'.
why is it not working? Do need to change the settings if i want to use a 'Something.Something' char?
Thanks!