hex2dec 5x slower than sscanf

조회 수: 2 (최근 30일)
Frank
Frank 2014년 12월 18일
댓글: Frank 2015년 1월 6일
Using hex2dec(str) and reading 4000 5-character hex values from a file takes about 1 sec. Using sscanf(str,'%x') takes about 200 ms. Seems like hex2dec could be improved!
  댓글 수: 2
Thorsten
Thorsten 2014년 12월 19일
True. So what is your question?
Frank
Frank 2015년 1월 6일
As a question: why does Mathworks provide a function that is 5x slower than an equivalent function?
As an enhancement request: It would be beneficial if Mathworks rewrote hex2dec, either in C, or as a wrapper for sscanf, instead of the existing kluge.
At the least, the documentation should state that hex2dec is very slow. I'm reading thousands of hex values, this makes the difference between a 1 minute wait and a 5 minute wait.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by