The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: CSVweatherdata
Replies: 4   Last Post: Dec 8, 2012 8:18 AM

Advanced Search

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

Posts: 9
Registered: 12/7/12
Re: CSVweatherdata
Posted: Dec 8, 2012 8:18 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I use xlsread for weather data and importdata for dates and actually because I have this ' in the data so matlab is not able to read them, but once I was able to read them in this format 1/1/2012 5:43 but I cant separate them to the arrays and vectors!!

a=importdata(CSVfilename); % Import CSV weather file
year = cellfun(@(x) x(7:10), b, 'UniformOutput', false);
year = cellfun(@(x)str2double(x), year);
month = cellfun(@(x) x(4:5), b, 'UniformOutput', false);
month = cellfun(@(x)str2double(x), month);
day = cellfun(@(x) x(1:2), b, 'UniformOutput', false);
day = cellfun(@(x)str2double(x), day);

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.