I have a class definition called BNS. I have multiple instances of this class named in the following convention e.g. Run3, Run4, etc. And I have multiple properties named as Mic1, Mic2, Mic3, etc. Based on inputs to a function, I would like to access specified properties of specified objects. My attempt is as follows:
objectname = strcat('Run', string(run)');
propertynamme = strcat('Mic', string(mic));
OASPL = objectname.propertyname;
where run and mic are doubles defined earlier.
I get the error 'Unrecognized method, property, or field 'propertyname' for class 'string'.'
I'm not sure how to make matlab recognize the string as a property of an object.