Create changing variable names inside a loop

1 visualización (últimos 30 días)
Matthew
Matthew el 9 de Nov. de 2012
Hello,
I want to create 120 new variables called:
RMS_BAM_186_Torque_8Nov_TIME
where TIME is a value from 0656 to 0856 <--- these are times, so max value is 0659, 0759, etc.
The function which will be used is:
RMS_BAM_186_Torque_8Nov_TIME = rms(BAM_186_Torque_8Nov_TIME)
where, the variables BAM_186_Torque_8Nov_TIME already exist.
Is there a way to program a loop which will do this, incrementing the TIME variable to step through all 120 iterations?

Respuestas (1)

Matt Fig
Matt Fig el 9 de Nov. de 2012
Don't program this way in MATLAB! Please take the time to learn proper programming techniques for the language you are using. This helpful FAQ will answer your question and explain how to do it properly.
  2 comentarios
Matthew
Matthew el 9 de Nov. de 2012
Editada: Matthew el 9 de Nov. de 2012
My data comes in from 120 .CSV files, which I read in using...
BAM_186_Torque_8Nov_0656 = xlsread('8NOV12 -- 0656.CSV',1,'G15:G1014');
Is there a way to create a 120x1000 matrix by reading every CSV?
The first line would contain all 1000 data points from the first CSV The second line would contain all 1000 data points from the second CSV
etc?

Iniciar sesión para comentar.

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by