Operation on multiple arrays

5 visualizaciones (últimos 30 días)
Paavo Auvinen
Paavo Auvinen el 8 de Mzo. de 2019
Comentada: Paavo Auvinen el 11 de Mzo. de 2019
I am struggling with a following problem. I have large amounts of experimental data. I import the time stamps as one column arrays in datetime format.
Let's call these arrays A,B,C... Now, for plotting I want to change the format to 'mm:ss', so I write A.Format='mm:ss'
Is there a convinient way to perform this Format operation (and similar operations) on several arrays at once or is For-loop and proper naming the only option?
I tried something like (A,B,C,D...).Format='mm:ss' but obviously without results.
Thank you for your help!
  4 comentarios
Stephen23
Stephen23 el 11 de Mzo. de 2019
Editada: Stephen23 el 11 de Mzo. de 2019
"I guess I could combine the arrays, however, my aim is to be able to process the data fast and avoid extra steps."
Importing your file data into one array is the fast way to solve this quickly and to avoid extra steps. Importing file data into one array is exactly what the MATLAB documentation shows:
"For technical reasons I get the data in separate files which results in several imported arrays."
The separate arrays should be combined into one numeric array, or stored in one container array (e.g. a cell array, as the MATLAB documentation shows), when you import the data.
"Trying to figure out the efficient way to this in MatLab as I'm eager to start using it over spreadsheet softwares."
The efficient way to do this is to import your data into one array, which you can trivially access using neat, simple, and very efficient indexing. In contrast, the approach you are trying forces you to write slow, complex, buggy, hard-to-debug code. Read this to know some of the reasons why:
Paavo Auvinen
Paavo Auvinen el 11 de Mzo. de 2019
Thank you for your insight, it was most helpful.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Low-Level File I/O en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by