필터 지우기
필터 지우기

how to import data into matlab

조회 수: 4 (최근 30일)
Innosens
Innosens 2012년 10월 25일
I have data from weather underground, i want to import this data into matlab, how i can import this data to matlab. please help me......
this example the data....
TimeMYT,TemperatureC,Dew PointC,Humidity,Sea Level PressurehPa,VisibilityKm,Wind Direction,Wind SpeedKm/h,Gust SpeedKm/h,Precipitationmm,Events,Conditions,WindDirDegrees,DateUTC 12:00 AM,25.0,24.0,94,1007,10.0,East,7.4,-,N/A,,Mostly Cloudy,100,2012-10-24 16:00:00 12:30 AM,25.0,24.0,94,1007,10.0,ESE,7.4,-,N/A,,Mostly Cloudy,110,2012-10-24 16:30:00 1:00 AM,25.0,23.0,89,1007,10.0,ESE,9.3,-,N/A,,Mostly Cloudy,110,2012-10-24 17:00:00 1:30 AM,24.0,23.0,94,1007,10.0,ESE,11.1,-,N/A,,Mostly Cloudy,110,2012-10-24 17:30:00 2:00 AM,24,23,92,1007,18,ESE,7.4,,,,Scattered Clouds,110,2012-10-24 18:00:00 2:00 AM,24.0,23.0,94,1006,10.0,ESE,7.4,-,N/A,,Mostly Cloudy,110,2012-10-24 18:00:00 2:30 AM,24.0,23.0,94,1006,10.0,ESE,9.3,-,N/A,,Mostly Cloudy,110,2012-10-24 18:30:00 3:00 AM,24.0,23.0,94,1006,10.0,ESE,7.4,-,N/A,,Mostly Cloudy,110,2012-10-24 19:00:00 3:30 AM,24.0,23.0,94,1006,10.0,ESE,11.1,-,N/A,,Mostly Cloudy,110,2012-10-24 19:30:00 4:00 AM,24.0,23.0,94,1006,10.0,ESE,7.4,-,N/A,,Mostly Cloudy,120,2012-10-24 20:00:00 4:30 AM,25.0,23.0,89,1006,10.0,ESE,9.3,-,N/A,,Mostly Cloudy,110,2012-10-24 20:30:00 5:00 AM,24,23,88,1006,18,ESE,7.4,,,,Scattered Clouds,110,2012-10-24 21:00:00 5:00 AM,24.0,23.0,94,1006,10.0,ESE,7.4,-,N/A,,Mostly Cloudy,110,2012-10-24 21:00:00 5:30 AM,25.0,23.0,89,1006,10.0,ESE,7.4,-,N/A,,Mostly Cloudy,120,2012-10-24 21:30:00 6:00 AM,24.0,23.0,94,1006,10.0,ESE,7.4,-,N/A,,Mostly Cloudy,120,2012-10-24 22:00:00 6:30 AM,24.0,23.0,94,1007,10.0,ESE,5.6,-,N/A,,Mostly Cloudy,120,2012-10-24 22:30:00 7:00 AM,25.0,23.0,89,1007,10.0,ESE,5.6,-,N/A,,Mostly Cloudy,120,2012-10-24 23:00:00 7:30 AM,25.0,22.0,83,1008,10.0,ESE,9.3,-,N/A,,Mostly Cloudy,120,2012-10-24 23:30:00 8:00 AM,25,23,80,1009,15,North,5.6,,,,Overcast,0,2012-10-25 00:00:00 8:00 AM,25.0,23.0,89,1008,10.0,North,5.6,-,N/A,,Mostly Cloudy,360,2012-10-25 00:00:00 8:30 AM,25.0,25.0,100,1009,4.0,NW,14.8,-,N/A,Rain,Rain,310,2012-10-25 00:30:00 9:00 AM,25.0,24.0,94,1008,4.0,ESE,1.9,-,N/A,Rain,Rain,110,2012-10-25 01:00:00 9:30 AM,26.0,25.0,94,1009,5.0,South,9.3,-,N/A,Rain,Light Rain,170,2012-10-25 01:30:00 10:00 AM,26.0,25.0,94,1009,5.0,SSE,9.3,-,N/A,Rain,Light Rain,160,2012-10-25 02:00:00

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2012년 10월 25일
편집: Azzi Abdelmalek 2012년 10월 25일
fid=fopen('data1.txt');
A=textscan(fid,'%s%s%s%s%s%s%s%s%s%s%s%s%s','delimiter',',');
fclose(fid);
  댓글 수: 2
Innosens
Innosens 2012년 10월 25일
Thanks Azzi ......
Innosens
Innosens 2012년 10월 25일
can i use textread for this data ?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Sachin Ganjare
Sachin Ganjare 2012년 10월 25일
편집: Sachin Ganjare 2012년 10월 25일
If this data is in .csv format then you can 'csvread' function in matlab.
Refer this link:
  댓글 수: 5
Innosens
Innosens 2012년 10월 25일
Sachin Ganjare
Sachin Ganjare 2012년 10월 25일
First capture data from website using 'urlread', you will get data in string.
Then use 'strread' function to parse the weather data.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by