Evaluate string as structure
Show older comments
I wish to load a structure based on a string input and copy the contents to a new structure. I can do this with eval, but would prefer not to.
For example:
user_string = 'structure_name';
load( user_string )
new_data = eval( user_string );
The structure 'structure_name' has several fields and is saved as a .mat file.
Using (user_string) to evaluate the structure isn't an option
Accepted Answer
More Answers (1)
Rob L
on 1 Oct 2019
0 votes
Categories
Find more on Structures in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!