Build script with data with timestamps
조회 수: 1 (최근 30일)
이전 댓글 표시
I some excel with data, one is this:
Where there is a timestamp ( number) that represents yyymmddHHMM (yearsmonthsdayshoursminutes)
I have another Excel with the following shape:
And Im creating a code in matlab where I have to use this data. But im having issues when using the timestamps because in the secound one, I will have to take into account at what timestamp I got the data, and at what timestamp the program has to use it.
The problem then is that I dont know how to make a loop where:
For a certain timestamp Do certain matematical operation with the corresponding data of colum (B in the first excel) and colum(D) in the second on ( is an example).
I have tried to create a timedata arrow ( and I manage to do so with the following code) if true %TIME is a column array with the timestamps
str=num2str(TIME,'%11d');
%TIME is a column array with the timestamps
dn = datenum(str, 'yyyymmddHHMM');
ds = datestr(dn, 'yyyy-mm-dd HH:MM'); % ‘Legacy’ Functions
TIMED = datetime(str, 'InputFormat','yyyyMMddHHmm', 'Format','yyyy-MM-dd HH:mm') % ‘datetime’ Function
TIME=array2table(TIMED)
PRICETABLE(:,1)= TIME
And now I have the data in two vectors ( dont know if it is a good idea)
But now im not able to make loops.
Thanks in advance
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!