How can I use dlmread to input data as single precision?
조회 수: 3 (최근 30일)
이전 댓글 표시
I am using dlmread to get input data and found that the return matrix is always double precision which is too big for the memory on my machine. I'm wonder anyhow I could make the reading use just single precision. Here is what I'm doing:
mat = dlmread('a.txt');
댓글 수: 0
채택된 답변
Todd Flanagan
2011년 2월 9일
I think you want to use textscan. That will allow you to specify the input format. The %f32 format will import as single precision. For example:
>> f = fopen('data.txt');
>> textscan(f, '%f32')
ans =
[3x1 single]
댓글 수: 1
Jan
2011년 2월 9일
You can create a copy of DLMREAD.M and insert this format specifier in the TEXTSCAN call. Then you have a fully featured DLMREAD with SIGNLE output.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!