how to overcome the memory limitation of importdata function?

5 views (last 30 days)
1.I 've a text file(size 300 MB) containing Headerlines up to 3 rows followed by numerical data(2 lakhs lines roughly), i'm not able to import the data using importdata function.It works well if the size of the file is less than 50 MB.Since the output of the importdata function suits very well for my code, i need a similar function which provides same sort of out put(textdata, data separately) or is there any ways to optimize the importdata function by editing it.
2.At times i happen to open 'n' number of text files from a folder,do analyze the data and save necessary values in different file.I get memory error,though i clear all the variables in the end of every loop.I could avoid this by restarting the MATLAB every time.I wonder if there is any other way around???
PS: i'm using Windows 8.1-32 bit sys. any help 'ud be appreciated.Thanks in advance

Answers (1)

Jan
Jan on 13 May 2015
Using a 32-bit OS is a severe drawback, because this limits the usable memory. So the best idea would be to install a modern 64-bit system and more RAM.
A 300MB text file will not exhaust your machine, if the memory is not occupied by other programs or variables. So close other applications. Clearing all variables is not necessarily a good idea. Please post your code to give us a chance to see, what's going on.
  1 Comment
DURAI KUMAR M
DURAI KUMAR M on 14 May 2015
Thank yo Jan for ur response...Nothing much abt the code,all i need to do is,juz to read about 4 to 5 columns from a delimited(.dat) text file of 60 columns.I need to identify those particular columns by their headers.Since importdata gives headerlines and num data separately its easier for me to pick those columns.Is there any function avilable that i can pick only certain columns by headers??? and regarding OS...i'm working on my official PC, so i can't do much abt that hence i need to figure out a way to optimize my algorithm.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!