From: Pedro Pastor on 4 May 2010 10:49 Dear all, I am quite new to MatLab and I'm struggling with file I/O for different situations. On this particular case I need to read a file of 4 columns [double] data, but depending on user selection I will read only certain number of consecutive rows depending on the values of the first column (ordered values of frequency). Then I'll read all the 4 columns from (Inital-Freq) to (Final-Freq) into a [? 4] matrix. I don't know the number of rows in advance. Which is the best (most efficient) way of performing that? In addition to this, there is another possible user selection (but less important): to choose the values from just one of the 3 last columns of the file. It would be difficult to add this new restriction? Regards, Pedro
From: Pedro Pastor on 11 May 2010 09:05 Hi, Has anybody implemented some kind of file reading like the one described below? Thanks, Pedro "Pedro Pastor" <pps(a)dlsi.ua.es> wrote in message <hrpc50$p6q$1(a)fred.mathworks.com>... > Dear all, > > I am quite new to MatLab and I'm struggling with file I/O for different situations. On this particular case I need to read a file of 4 columns [double] data, but depending on user selection I will read only certain number of consecutive rows depending on the values of the first column (ordered values of frequency). Then I'll read all the 4 columns from (Initial-Freq) to (Final-Freq) into a [? 4] matrix. I don't know the number of rows in advance. > > Which is the best (most efficient) way of performing that? > > In addition to this, there is another possible user selection (but less important): to choose the values from just one of the 3 last columns of the file. It would be difficult to add this new restriction? > > Regards, > Pedro
From: dpb on 11 May 2010 14:06 Pedro Pastor wrote: > Dear all, > > I am quite new to MatLab and I'm struggling with file I/O for different > situations. On this particular case I need to read a file of 4 columns > [double] data, but depending on user selection I will read only certain > number of consecutive rows depending on the values of the first column > (ordered values of frequency). Then I'll read all the 4 columns from > (Inital-Freq) to (Final-Freq) into a [? 4] matrix. I don't know the > number of rows in advance. > > Which is the best (most efficient) way of performing that? I'd simply read the file and then clear the unwanted portion of the array unless it were terribly huge. Probably faster than the overhead of reading portions of the file. > In addition to this, there is another possible user selection (but less > important): to choose the values from just one of the 3 last columns of > the file. It would be difficult to add this new restriction? Same thing...work on the data in memory instead of on disk. --
|
Pages: 1 Prev: Logarithmic Scale in Boxplot Next: active x - formatting excel cells from Matlab |