how can i extract data of specific dates in a big excel file and save in a different excel file?

1 Ansicht (letzte 30 Tage)
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 Kommentare
Bob Thompson
Bob Thompson am 31 Okt. 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

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Mir Amid Hashemi
Mir Amid Hashemi am 4 Nov. 2019
It might be useful to use Tall Arrays. These arrays are not completely loaded into memory if they are really big.
Amid.

Weitere Antworten (0)

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by