Hi!
I've been trying a bunch of ways to treat some data, so I end up having a few variable called "treated_data_blablabla".
Let's say I want to do an operation on all of those variable (plot them, normalize them, etc). How can I just access them all, or loop through them?
I can get the list of them with
but that's only displayed. I managed to get the list in a variable with
test = who('-regexp','treated_data*');
But this is a matrix of cells, not even strings. So I still don't know how I access the variables whose names are in stored in test
7 Comments
Julien Gorenflot (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/356673-operation-on-variables-whose-name-contain-a-certain-string#comment_484372
Rik (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/356673-operation-on-variables-whose-name-contain-a-certain-string#comment_484383
Guillaume (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/356673-operation-on-variables-whose-name-contain-a-certain-string#comment_484386
Stephen Cobeldick (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/356673-operation-on-variables-whose-name-contain-a-certain-string#comment_484392
Julien Gorenflot (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/356673-operation-on-variables-whose-name-contain-a-certain-string#comment_485566
Stephen Cobeldick (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/356673-operation-on-variables-whose-name-contain-a-certain-string#comment_485578
Jan (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/356673-operation-on-variables-whose-name-contain-a-certain-string#comment_485982
Sign in to comment.