What did they change to 'fread' on 2020a?
조회 수: 4 (최근 30일)
이전 댓글 표시
The left is 2020a, and the right is 2019a.
As the picture says, it takes significant longer time to execute and sometime it returns different resutls.
댓글 수: 0
채택된 답변
Walter Roberson
2020년 5월 19일
File I/O functions, such as fscanf and fprintf, use automatic character set detection and UTF-8 encoding by default
Behavior change
As of R2020a, character-oriented file I/O functions such as fscanf, fgets, and fgetl trigger automatic character set detection when reading a file that was opened using fopen without a specified encoding.
Similarly, fprintf defaults to using UTF-8 encoding when writing a file that was opened using fopen without a specified encoding
You probably have a large file, and fread() is having to scan through a lot of the file to try to figure out what the character encoding is.
I would suggest that better code for you would be
beg4c = fread(fid, [1 4], 'uint8=>char');
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!