MATLAB: How to form a loop to perform calculations on series of variables in workspace

for loop

Matlab novice here; I have a set of data sheets with numbers loaded into workspace named, data1, data2,…,data50.
I am hoping to extract certain columns of data for analysis from data1 to data50 in a loop e.g.
for j=1:50
A = data{j}(:,3);
B = myAnalysis(A)
The idea is to extract the 3rd column from dataj and then use it for calculations. Any help would be much appreciated!

Best Answer

Firstly, have a look at this:
Naming the variables "data1, data2,...,data50" creates trouble and extra work.
"data sheets". Have you read the data from Excel?