Out of memory error
조회 수: 3 (최근 30일)
이전 댓글 표시
My data looks like this in the picture.I am using textscan to scan the data.But sometimes when the data is little bit larger it gives me error of less memory.If you see the picture each number is multiple decimal places which I do not need.Is there any way I can read the data having having three digits after the decmal.This will also remove the memory error.I am using Matlab 2015a.Thank You
댓글 수: 0
답변 (1개)
Walter Roberson
2020년 10월 29일
No. If you have any digits after the decimal point, then you are using floating point numbers, and floating point numbers do not use less storage if you have fewer decimal digits. The storage required for 3.0 is the same as for 3.5 is the same as for 3.25 is the same as 3.125 is the same as 3.14159265 -- 8 bytes in each case for double precision values.
What you can do is switch from using '%f' format to using '%f32' format. %f32 uses single precision values, which take only 4 bytes (32 bits) instead of 8 bytes (64 bits). This will use only half as much storage.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!