read_float.m

버전 1.0.0.1 (2.62 KB) 작성자: Erik Benkler
Read numbers with user definable digit group and decimal separators from a text file.
다운로드 수: 542
업데이트 날짜: 2021/12/9

라이선스 보기

SORRY, I DO NOT MAINTAIN THIS ANY MORE BUT LEAVE IT ON FILE EXCHANGE AS IS.
I switched to python.
This function reads in numbers from a text file and stores them to a cell array. It solves the problem that often the numbers in the text file are written by programs (e.g. MS Excel) using the Windows regional settings for the format of a number, e.g. 100,000.123 (english) or 100.000,123 (german). Matlab does not use windows locale settings. read_float uses either the Windows locale settings or user specified characters for the digit group and decimal separators. The numbers are detected using a regular expression which matches any floating point number (even complex numbers, see documentation of str2double.m)
The regular expression is described in a comment in the m-file and could be useful and easily adapted for similar purposes.
Using this function, there is no need to pre-process the text file, e.g. by substituting all commas by dots in a file using a comma as decimal separator.

인용 양식

Erik Benkler (2026). read_float.m (https://kr.mathworks.com/matlabcentral/fileexchange/26646-read_float-m), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R14SP2
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Text Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.1

SORRY, I DO NOT MAINTAIN THIS ANY MORE BUT LEAVE IT ON FILE EXCHANGE AS IS.

1.0.0.0