필터 지우기
필터 지우기

Textscan: 2013b VS 2016a

조회 수: 3 (최근 30일)
Daan Wielens
Daan Wielens 2016년 9월 12일
댓글: Daan Wielens 2016년 9월 12일
Hi,
I have created a script to import data from a certain file by using textscan. On my own computer (OS X, R2016a) the script works, but on the desktop at work (Windows, R2013b), the script crashes at textscan.
Therefore, I took one line out of the input file (denoted x in the code) which I'd like to import. I created a simple script:
x = '06.11.2015 14:34:36 7 25.6 24 20.5 20.5 0 0 0 6152 0 0 0 0 0 14 34 62 29.2 0 0 0 0';
M = textscan(x, '%{dd.MM.yyyy HH:mm:ss}D %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f','Delimiter','\t');
On R2016a, M becomes a 1x23 cell with the data in it. On R2013b, I get:
Error using textscan
Badly formed format string
Why is the script working on R2016a but not on R2013b?

채택된 답변

George
George 2016년 9월 12일
You're trying to convert one of the fields to a datetime, which wasn't introduced into 2014b.
  댓글 수: 1
Daan Wielens
Daan Wielens 2016년 9월 12일
Thanks, that explains a lot!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile 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!

Translated by