- your data file
- your code (instead of an image of your code)
Append rows to a starting row
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jeffrey Dhas
el 24 de Oct. de 2021
Editada: Jeffrey Dhas
el 24 de Oct. de 2021
I have some data exported in a txt file which has 780 rows x 5 columns. The problem I am running into is that the correct interpretation of the data takes the 1st row, then append the 2nd row onto the first, then the 3rd onto this appended set, and so on...
Does anyone have an elegant way to achieve this? I have included a sample output of just the first two rows as an example:

0 comentarios
Respuesta aceptada
the cyclist
el 24 de Oct. de 2021
Editada: the cyclist
el 24 de Oct. de 2021
It would be much easier for us to help if you uploaded
However, it seems all you need is to take the transpose, and then convert to a vector. I think this will do what you want, but I can't be sure because I can't test it against your data:
T = csvread('matlab test.csv');
temp = T.';
output = temp(:);
The reason for doing the transpose first is that when the last line of code converts to a vector, it is going to read down each column in turn (because that is how the array is stored internally).
1 comentario
Jeffrey Dhas
el 24 de Oct. de 2021
Editada: Jeffrey Dhas
el 24 de Oct. de 2021
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Type Identification 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!