I need a function or code equivalent to str2double, but it is very fast.

조회 수: 2 (최근 30일)
Clodoaldo de Souza Faria Júnior
편집: Rik 2021년 9월 21일
This is slowing down my code, at some point it takes 6 seconds per iteration in this function only.
  댓글 수: 1
Rik
Rik 2021년 9월 21일
편집: Rik 2021년 9월 21일
I tend to operate with the assumption that the built-in solution will be the fastest for the general problem. If you have a non-general problem there may be faster solutions.
This implies that you will have to tell use more details, otherwise the answer will be to buy a faster computer.
Can you give an example of the code that makes str2double take 6 seconds? Or are you just calling it so often the total time spent in str2double is 6 seconds? Might it be possible to reduce the number of calls in some way?
This FEX submission was linked in the sidebar on this page. You would still have to fix the memory leak, but it claims to be faster.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by