How to insert a row into multiple fields (within a structure)
Mostrar comentarios más antiguos
Hi All,
My code looks as follows:
clear all;
close all;
clc
[~, Sheets] = xlsfinfo('GPSdata2018copy.xlsx');
nSheets = length(Sheets);
Data =[]
GPS = struct
for i = 1:nSheets
Player = Sheets{i};
[Data,~,Raw] = xlsread('GPSdata2018copy.xlsx', Player, 'E8:KE16');
Dates = datetime(Data(1,:),'convertfrom','excel');
Data(1,:) = datenum(Dates);
GPS = setfield(GPS, Player, Data);
end
I want to add a row to each of my fields in the second row under the dates without removing any of the data that is in there (just moving the data down). Can someone please tell me how to do that? Do I do it in the loop, our have to do it to the Data that I read over?
Kind regards, Mat
1 comentario
Christopher Wallace
el 16 de Jul. de 2018
Mat,
Please attach your data file as well.
Respuesta aceptada
Más respuestas (2)
Mathew Grey
el 16 de Jul. de 2018
0 votos
Mathew Grey
el 17 de Jul. de 2018
0 votos
Categorías
Más información sobre Structures 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!
