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