概述
function funOnMarketData(varargin)
global countInst instruments recInstrument; %recInstrument1 countInst1 ;
InstrumentID = varargin{3};
BidPrice1 = varargin{4};
BidVolume1 = num2cell(varargin{5});
AskPrice1 = varargin{6};
AskVolume1 = varargin{7};
OpenPricel = varargin{8};
HighestPrice = varargin{9};
LowestPrice = varargin{10};
LastPrice = varargin{11};
OpenInterest = varargin{12};
Volume = varargin{13};
UpperLimitPrice = varargin{14};
LowerLimitPrice = varargin{15};
PreSettlementPrice = varargin{16};
AveragePrice = varargin{17};
UpdateTime = strcat(num2str(varargin{18}),':',num2str(varargin{19}));
if InstrumentID == char(instruments(1,1))
%if not state No.of instruments,need to put in front
countInst = countInst + 1;
recInstrument(countInst,1)= {char(datestr(now,'yyyy-mm-dd'))};
DATA(countInst,2:14) = [UpdateTime,InstrumentID,OpenPricel,HighestPrice,LowestPrice,...
LastPrice,BidPrice1,BidVolume1,AskPrice1,AskVolume1,Volume,OpenInterest,PreSettlementPrice];
OS30 = DATA(1:60:(length(countInst)-60),7);
S30 = DATA(60:60:(length(countInst)),5:7);
OM1 = DATA(1:120:(length(countInst)-120),7);
M1 = DATA(120:120:(length(countInst)),5:7);
OM3 = DATA(1:360:(length(countInst)-360),7);
M3 = DATA(360:360:(length(countInst)),5:7);
OM5 = DATA(1:600:(length(countInst)-600),7);
M5 = DATA(600:600:(length(countInst)),5:7);
OM10 = DATA(1:1200:(length(countInst)-1200),7);
M10 = DATA(1200:1200:(length(countInst)),5:7);
OM15 = DATA(1:1800:(length(countInst)-1800),7);
M15 = DATA(1800:1800:(length(countInst)),5:7);
OM30 = DATA(1:3600:(length(countInst)-3600),7);
M30 = DATA(3600:3600:(length(countInst)),5:7);
end
最后
以上就是害怕睫毛为你收集整理的matlab每隔一定时间,按固定时间间隔更新数据的全部内容,希望文章能够帮你解决matlab每隔一定时间,按固定时间间隔更新数据所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复