For 'readtable' func parameter 'Format' is not recognized although importing from a text
조회 수: 4 (최근 30일)
이전 댓글 표시
filename = fullfile('C:','Beacon_Data','FL-SB1_SensorTest_Data[1].txt');
opts = detectImportOptions(filename);
formatSpec = '%s%{dd-MM-yyyy HH:mm:ss}D%s%s%s%s%s%s%s%s';
T = readtable(filename, opts, 'ReadVariableNames', false, 'Format', formatSpec);
Note that this is just the related segment of the code!
One row of the specified text file is as stated:
ID: FL-SB1-05; 05-07-2018 14:18:56; BatteryVol: 4117; T: 2909; Acc: -3949, 395, 759; Gyro: -149, 148, -136;
댓글 수: 0
채택된 답변
dpb
2018년 7월 9일
As documented...
T = readtable(filename,opts,Name,Value) creates a table using the import options and with
additional options specified by one or more of these name-value pair arguments: ReadVariableNames,
ReadRowNames, DateLocale, Encoding, Sheet, and Basic.
'Format' is not one of the allowed name-value pair arguments when using an opts object; if you wish to use other than the detected variable type/format must change the opts object itself with the get/setvaropts pair.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!