I have a workspace with about 200 tables. I frequently need to run similar operations (scripts) on all the tables.
- First, is there a way to create an array that automatically pulls the names of the tables?
- Second, no matter if the first one is possible or not; if I have a cell array containing all the names of the tables is there a way that can call these names and apply operations/scripts on them.
For example If I have the tables x_1, x_2, x_3 … , x_200 in the workspace.
var_names = {'x_1'; 'x_2'; 'x_3' ... 'x_200'}; %is there an easier way to do this. % if I want for example to multiply the first column in the three variable, I currently have to do it like this
%
x_1{:, 1}= x_1{:, 1} * 100; x_2{:, 1}= x_2{:, 1} * 100; x_3{:, 1}= x_3{:, 1} * 100; ... x_200{:, 1}= x_200{:, 1} * 100; % % is there anoter way to use a loop to call all the variables using the var_names array? It should in principle look like this.
% for n = 1:200; "something(n)" = "something(n)" * 100; end
Thanks in advance.
Best
Antonius
Best Answer