Rank: 688 based on 115 downloads (last 30 days) and 3 files submitted
photo

Andres

E-mail

Personal Profile:

Professional Interests:

 

Watch this Author's files

 

Files Posted by Andres View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
22 Jan 2010 Screenshot MuFFE - figure manager gui keep track of your figures and save them easily Author: Andres figure manager, gui, gui tools, figure, graphics export 12 0
17 Nov 2009 txt2mat fast and versatile ascii data import capable of handling large text files Author: Andres ascii, data import, import, csv, file, conversion 95 24
  • 4.81818
4.8 | 22 ratings
09 Jul 2009 Screenshot surfo workaround for surface lighting with OpenGL Author: Andres workaround, opengl, surf, surface, plot, light 8 1
  • 5.0
5.0 | 1 rating
Comments and Ratings by Andres View all
Updated File Comments Rating
16 May 2010 txt2mat fast and versatile ascii data import capable of handling large text files Author: Andres

Thanks for your feedback. Indeed it would be nice to have a handy column selection input argument instead of using 'ConvString' with something like '%f %*f %f %*f %f'.
Regarding your memory issue, so far I can only refer to the 'NumericType' param and especially to example 6, but you probably found that in the doc already. txt2mat reads in the whole part of the file that is to be imported and initializes the output array. In an extreme case, a double array holding the data may consume about four times more memory than the file, unless some rows have missing values. I am thinking about making txt2mat more memory efficent - e.g. avoid slurping large files - without noticeably loosing speed (but tbh I have hardly any spare time now).

09 Apr 2010 interparc Interpolate points as a function of arc length along a space curve (in 2 or more dimensions) Author: John D'Errico

In some cases, there's a problem with a curve end:

xTest = sqrt([0:0.1:0.5,0.4:-0.1:0]);
yTest = 5:-0.5:0;
ptTest = interparc(linspace(0,1,15),xTest,yTest,'linear');
figure
plot(xTest,yTest,'b.-')
hold on
plot(ptTest(:,1),ptTest(:,2),'r.-')

Perhaps this affects the 'linear' method only. Adding
tbins(end) = n-1;
at line 233 helped me out, but this is more or less a quick shot in the dark, I hope John will care for it. Thanks again,
Andres

08 Apr 2010 txt2mat fast and versatile ascii data import capable of handling large text files Author: Andres

It would be most simple if you could uniquely identify every line of text by some string (or some few strings), as with 'tex' (or just 'x') in your example:

txt2mat('example.txt','BadLineString',{'tex'})

If that is not possible, you could read in all lines and then remove all NaN-only rows:

A = txt2mat('example.txt',0,'ReadMode','line')
A = A(any(isfinite(A),2),:)

If things are more complex, you may also contact me via the 'Contact Author' link. Good luck!

30 Mar 2010 interparc Interpolate points as a function of arc length along a space curve (in 2 or more dimensions) Author: John D'Errico

Seems perfect in every respect. I used it to reduce the number of points of a curve which was given with unevenly distributed data. Thanks.

02 Feb 2010 Convert TDMS (v2) Import a TDMS v2 file as a matlab object (ob). Author: Grant

I did not test convertTDMS.m extensively, but I'll give it 5 stars as it worked with my files without any problem. Thanks, Grant!

Comments and Ratings on Andres' Files View all
Updated File Comment by Comments Rating
13 Jul 2010 txt2mat fast and versatile ascii data import capable of handling large text files Author: Andres Lengwiler, Yvan

I haven't looked at the code yet, but I have used this submission to read in 1 GB of data. It just worked beautifully, very fast, and allowed me to filter out bogus lines. Very useful submission.

14 Jun 2010 txt2mat fast and versatile ascii data import capable of handling large text files Author: Andres Akshay

Thanks for your reply, Andres. Really, Mathworks should take your function and put it in their base functions - you have taken great efforts!!

16 May 2010 txt2mat fast and versatile ascii data import capable of handling large text files Author: Andres Andres

Thanks for your feedback. Indeed it would be nice to have a handy column selection input argument instead of using 'ConvString' with something like '%f %*f %f %*f %f'.
Regarding your memory issue, so far I can only refer to the 'NumericType' param and especially to example 6, but you probably found that in the doc already. txt2mat reads in the whole part of the file that is to be imported and initializes the output array. In an extreme case, a double array holding the data may consume about four times more memory than the file, unless some rows have missing values. I am thinking about making txt2mat more memory efficent - e.g. avoid slurping large files - without noticeably loosing speed (but tbh I have hardly any spare time now).

07 May 2010 txt2mat fast and versatile ascii data import capable of handling large text files Author: Andres Akshay

An awesome and VERY helpful function!!! The param/value pairs are great - especially 'BadLineString' and 'RowRange'.

Small suggestion for future spins - if possible, having a 'ColumnRange" would be great.

Btw, I ran into an "Out of Memory" situation when processing a 355MB file, even though I have 3GB RAM and the 'memory' command reported that have atleast ~500MB for a single array (~1200MB for arrays). Any ideas how to fix this?

Thanks!!!

08 Apr 2010 txt2mat fast and versatile ascii data import capable of handling large text files Author: Andres Andres

It would be most simple if you could uniquely identify every line of text by some string (or some few strings), as with 'tex' (or just 'x') in your example:

txt2mat('example.txt','BadLineString',{'tex'})

If that is not possible, you could read in all lines and then remove all NaN-only rows:

A = txt2mat('example.txt',0,'ReadMode','line')
A = A(any(isfinite(A),2),:)

If things are more complex, you may also contact me via the 'Contact Author' link. Good luck!

Top Tags Applied by Andres
ascii, conversion, csv, data, data import
Files Tagged by Andres View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
22 Jan 2010 Screenshot MuFFE - figure manager gui keep track of your figures and save them easily Author: Andres figure manager, gui, gui tools, figure, graphics export 12 0
17 Nov 2009 txt2mat fast and versatile ascii data import capable of handling large text files Author: Andres ascii, data import, import, csv, file, conversion 95 24
  • 4.81818
4.8 | 22 ratings
09 Jul 2009 Screenshot surfo workaround for surface lighting with OpenGL Author: Andres workaround, opengl, surf, surface, plot, light 8 1
  • 5.0
5.0 | 1 rating

Contact us at files@mathworks.com