str2double breaks when you pass in a vector?
조회 수: 10 (최근 30일)
이전 댓글 표시
this works:
double = str2double('06012015');
but this doesn't:
doubles = str2double(['06012015' '06022015']);
whos doubles gives me this:
-------
6.0120e+14
Name Size Bytes Class Attributes
doubles 1x1 8 double
-------
댓글 수: 1
답변 (2개)
KSSV
2016년 12월 28일
str1 = str2double([{'106012015'} {'06022015'}])
str2 = str2num(['06012015' ;'06022015'])
댓글 수: 2
Sean de Wolski
2016년 12월 28일
In >=R2016b, you can just call double on the string directly:
double(string({'06012015' '06022015'}))
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!