I have groups of descriptive variable names and dont want to write explicit code for each group, e.g. (and this is a contrived simplification)
EnergySensorALow=somefuncALow[#]& /@ lstSensorA; EnergySensorAHigh=somefuncAHigh[#]& /@ lstSensorA; EnergySensorBLow=somefuncALow[#]& /@ lstSensorB; EnergySensorBHigh=somefuncAHigh[#]& /@ lstSensorB;
I want create a function that should work as follows:
fnew[sensorType_String]:= "EnergySensor"+sensorType+"Low"="somefunc"+sensorType+"Low"[#]& /@ "lstSensor"+sensorType;
So the function will take an input String, e.g. "A" and then refer to an existing variable name EnergySensorALow, which it will set equal to an existing function somefuncALow[#]& and map this over an existing list lstSensorA
The code will also be run periodically when the sensor values update, and each time the function needs to be applied to the list and stored in the appropriate "EnergySensor" variable name. The variable index[n] makes it easy to use the data in a Manipulate and select which dataset needs to be plotted, I prefer not to add additional indexes to accomplish the functionality I need.