how can i extract data of specific dates in a big excel file and save in a different excel file?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
KIPROTICH KOSGEY
el 31 de Oct. de 2019
Respondida: Mir Amid Hashemi
el 4 de Nov. de 2019
Hi,
Please i would like to extract data of some specific dates in the output file (data.xlsx) of the following function, and save in another excel file (data1.xlsx). Can someone please help?
y0=[0.02352;0.00048;0.0288;0.00432;0.216;0.1104;0.1104;2;2;2;55;50;0.5];
h=0.0006944444;
tSpan=0:h: 535;
M=[ 1 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 1];
options = odeset('RelTol',eps^20,'AbsTol',1e-2, 'Mass', M);
[tSol, ySol]=ode23t(@(t, y) MBBRFun5(t,y), tSpan, y0, options);
xlswrite('F:\Matlab\data.xlsx',[tSol, ySol]);
I would like to extract data for t=4, 6, 7, 9.... etc in data.xlsx
Thanks in advance
4 comentarios
Bob Thompson
el 31 de Oct. de 2019
What does t actually represent other than different values of tspan. I know I spoke about t(4) earlier, but from what I understand of your code, t(4) doesn't actually exist because t is a temporary assignment from tspan. If you want the four value of t use tspan(4).
vals = [4 6 7 9 ...]; % Identify the indices you want
tspan(vals); % This is the values you want
Respuesta aceptada
Mir Amid Hashemi
el 4 de Nov. de 2019
It might be useful to use Tall Arrays. These arrays are not completely loaded into memory if they are really big.
I would recommend to go to https://uk.mathworks.com/help/matlab/import_export/tall-arrays.html
Amid.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Type Conversion 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!