I am converting a MATLAB script into python. The MATLAB script uses some kind of objects hierarchy for different input variables as in:
parameterA.subparameter1= A1;
parameterA.subparameter2= A2;
parameterB.subparameter1= B1;
parameterB.subparameter2= B2;
Where A1,A2,B1,B2
can all be strings and numbers. I wish to convert this to python and I have used
parameterA.subparameter1= A1
parameterA.subparameter2= A2
parameterB.subparameter1= B1
parameterB.subparameter2= B2
Now I am getting the error:
NameError: name 'parameterA' is not defined
I have tried to initialize them by using either parameterA,parameterB=[],[]
, which is not good because I want objects and not a list or parameterA,parameterB=set(),set()
according to this post as well as some other solution.
Is this at all the correct approach? How do I initialize this structure? Is there a better way to do this?