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

1 view (last 30 days)
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 Comments
Bob Thompson
Bob Thompson on 31 Oct 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

Sign in to comment.

Accepted Answer

Mir Amid Hashemi
Mir Amid Hashemi on 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.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!