Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: xlsread not working with Excel 2010
Replies: 4   Last Post: Apr 4, 2013 3:58 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Barry Williams

Posts: 312
Registered: 6/14/06
Re: xlsread not working with Excel 2010
Posted: Apr 1, 2013 6:41 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> HI Barry - Thanks for your help!
>
> I've tried csvread, but I couldn't get it to work because of the string in the last column. I've not managed to find a command that would read my csv ignoring the last field.
>
> Barry, for some reason when I feel your code my CSV (I can't upload it anywhere), I get a cell array of empty doubles and a string. I don't quite understand why it doesn't work for me, when it did for you.
>
> I'd be perfectly happy to not read in that last field (20mm/min) from the files (there are many that I have to process) but I haven't found the right command.
>
> Thanks - I'll keep working - looking at your code to see if I can somehow tweak it...


Sample : Default
Span : 10.0
Width : 5.0
Thickness : 1.0
Start Sampletime : 100ms
Start Speed : 20mm/min
Gain : x1
Video file :
Scale : 0.078
Number of points : 309
Ver6.1.83
Tensile


Test duration : 30.9000000000002s
Max travel : 9.992mm
Max extension : 0.000mm
Comment : 200N single leadscrew tensile with 67:1 gearbox & 256 line encoder. Calibrated at 20N. Trip set to 20N
Point,"Elongation","Force","Position","Code","Samplerate","Motorspeed"
.1,-10.068,.023,.0032,2,100,"20mm/min"
.2,-10.068,.024,.0032,0,100,"20mm/min"
.3,-10.068,.024,.0032,0,100,"20mm/min"
.4,-10.068,.015,.0032,0,100,"20mm/min"
.5,-10.068,.062,.0032,0,100,"20mm/min"
.6,-10.059,.198,.0117,0,100,"20mm/min"
.7,-10.039,.415,.0322,0,100,"20mm/min"
.8,-10.015,.614,.0557,0,100,"20mm/min"
.9,-9.991,.801,.0803,0,100,"20mm/min"
1,-9.962,.973,.109,0,100,"20mm/min"

Please don't top post.
It's a bit difficult to sort out exactly what is in your csv files. Are there 20 header lines, with the last header line starting with Point,"Elongation"...? If yes, how many of the header lines do you need to read? Textscan includes an optional switch:

fid=fopen('csv_file.csv','r');
data=textscan(fid,'%n %n %n %n %n %n %s','delimiter',',', 'headerlines', 20);
fclose(fid);
Barry




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.