Get data from multi-level struct using strings
Afficher commentaires plus anciens
I need to read data into matlab where a text file specifies the structure and index of the data and another file contains the data itself.
Currently the implementation is done using an eval statement, e.g.
eval(['data.' dataName '=value;'])
I would like to use parfor instead since there are a many large files to process but parfor doesn't allow eval. I tried fixing it by replacing the eval statement with:
data.(dataName) = value;
The issue I'm running into is that dataName specifies multiple levels of a struct, e.g. dataName = 'a.b.c', which gives me an error.
Is there any way to make this work?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Structures dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!