How do I form a loop to perform calculations on series of variables in workspace?
Mostrar comentarios más antiguos
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!
1 comentario
Jan
el 2 de Oct. de 2012
While "data1" looks like a bad programming practize, "data{1}" is most likely the best way to go.
Respuesta aceptada
Más respuestas (2)
Image Analyst
el 2 de Oct. de 2012
0 votos
I assume datasheets mean "worksheets" in an Excel "workbook" - just trying to get the terminology accurate. If so, you definitely don't want to use xlsread() unless you don't mind waiting forever. How comfortable or confident are you with using, or learning, ActiveX programming? Because that's what you'll need to do this efficiently.
Lei Gao
el 2 de Oct. de 2012
0 votos
Categorías
Más información sobre Spreadsheets en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!