You can use indexing to access the fields of data structure. Some people have also developed some API for accessing data structure in MATLAB.
You can also generate field names from variables. Please refer to following link for more information.
It is not clear from code that what fields and data fields are present in your potato structure. If you need more inputs on this, Please share your structure details.