cell2mat functìon
how to extract the big content of a cell array?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi! I have a 2859x1 cell array. In each cell there is a content like this:
1617026479572040798,,0,,0,0,'',25.0,,,[],0,"[76, 74, 71, 78, 76, 77, 73, 76, 73, 76, 79, 154, 158, 164, 166, 149, 134, 137, 131, 124, 123, 121, 114, 121, 117, 109, 120, 117, 115, 106, 104, 110, 111, 116, 116, 114, 109, 115, 114, 110, 106, 113, 109, 114, 114, 113, 118, 107, 110, 109,.....
I would like to save the numbers it into a double array. How could I do that? Thanks
댓글 수: 11
Peter Perkins
2021년 8월 9일
The problem is that once you type 1617026479572040798, you are already done for:
>> sprintf("%.20f",1617026479572040798)
ans =
"1617026479572040704.00000000000000000000"
If it's wrapped in uint64, things are OK,
>> uint64(1617026479572040798)
ans =
uint64
1617026479572040798
but then the question is how to get that into a datetime with as much precision as possible. The solution is epochtime:
>> datetime(uint64(1617026479572040798), 'convertfrom', 'epochtime','TicksPerSecond',1e9,'Epoch','1-Jan-1970','Format','dd-MMM-uuuu HH:mm:ss.SSSSSSSSS')
ans =
datetime
29-Mar-2021 14:01:19.572040798
Stephen23
2021년 8월 10일
"Unfortunately I don't know how these data were stored. The file was given to me like this."
This contradicts your statement that "The whole file is too big to import so I selected just 3 cells."
Please upload an original file as requested. Do not upload data that you have already imported into MATLAB.
If the original file is too large to upload onto the forum, please shorten it whilst keeping its format representative.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!