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 Center および File ExchangeIntroduction 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