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

1 次查看(过去 30 天)
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 个评论
Bob Thompson
Bob Thompson 2019-10-31
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

请先登录,再进行评论。

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by