对于该任务,我们必须创建一个程序,根据其WBAN ID读取六个特定站点的每日天气数据,并找到特定月份的平均温度值。问题是,文件已制成,因此人们无法读取。看起来真是胡说八道。我需要的值在标题Tavg下。
文件内容如下: (请注意,文本的第一块应该是标题行)
WBAN,YearMonthDay,Tmax,TmaxFlag,Tmin,TminFlag,Tavg,TavgFlag,Depart,DepartFlag,DewPoint,DewPointFlag,WetBulb,WetBulbFlag,Heat,HeatFlag,Cool,CoolFlag,Sunrise,SunriseFlag,Sunset,SunsetFlag,CodeSum,CodeSumFlag,Depth,DepthFlag,Water1,Water1Flag,SnowFall,SnowFallFlag,PrecipTotal,PrecipTotalFlag,StnPressure,StnPressureFlag,SeaLevel,SeaLevelFlag,ResultSpeed,ResultSpeedFlag,ResultDir,ResultDirFlag,AvgSpeed,AvgSpeedFlag,Max5Speed,Max5SpeedFlag,Max5Dir,Max5DirFlag,Max2Speed,Max2SpeedFlag,Max2Dir,Max2DirFlag
00102,20160101,M, ,M, ,M, ,M, ,26, ,27, ,M, ,M, ,-, ,-, ,SN BR UP, ,M, ,M, ,M, ,M, ,M, ,29.62, , 2.1, ,11, ,M, ,M, ,M, ,M, ,M,
00102,20160102,M, ,M, ,M, ,M, ,25, ,28, ,M, ,M, ,-, ,-, ,SN, ,M, ,M, ,M, ,M, ,M, ,29.24, , 7.5, ,07, ,M, ,M, ,M, ,M, ,M,
00102,20160103,M, ,M, ,M, ,M, ,29, ,31, ,M, ,M, ,-, ,-, ,RA SN BR, ,M, ,M, ,M, ,M, ,M, ,29.56, , 8.2, ,14, ,M, ,M, ,M, ,M, ,M,
00102,20160104,M, ,M, ,M, ,M, ,23, ,29, ,M, ,M, ,-, ,-, ,SN, ,M, ,M, ,M, ,M, ,M, ,29.61, ,12.8, ,09, ,M, ,M, ,M, ,M, ,M,
00102,20160105,M, ,M, ,M, ,M, ,22, ,29, ,M, ,M, ,-, ,-, ,RA SN BR, ,M, ,M, ,M, ,M, ,M, ,29.52, ,15.2, ,10, ,M, ,M, ,M, ,M, ,M,
00102,20160106,M, ,M, ,M, ,M, ,21, ,23, ,M, ,M, ,-, ,-, ,SN BR, ,M, ,M, ,M, ,M, ,M, ,29.92, , 6.5, ,14, ,M, ,M, ,M, ,M, ,M,
00102,20160107,M, ,M, ,M, ,M, ,6, ,9, ,M, ,M, ,-, ,-, ,SN BR, ,M, ,M, ,M, ,M, ,M, ,30.05, , 2.8, ,05, ,M, ,M, ,M, ,M, ,M,
00102,20160108,M, ,M, ,M, ,M, ,1, ,5, ,M, ,M, ,-, ,-, , , ,M, ,M, ,M, ,M, ,M, ,30.14, , 2.0, ,06, ,M, ,M, ,M, ,M, ,M,
00102,20160109,M, ,M, ,M, ,M, ,1, ,7, ,M, ,M, ,-, ,-, , , ,M, ,M, ,M, ,M, ,M, ,29.99, , 6.5, ,06, ,M, ,M, ,M, ,M, ,M,
00102,20160110,M, ,M, ,M, ,M, ,6, ,16, ,M, ,M, ,-, ,-, , , ,M, ,M, ,M, ,M, ,M, ,30.03, ,10.7, ,09, ,M, ,M, ,M, ,M, ,M,
答案 0 :(得分:0)
这是一个csv文本,以逗号分隔。如果另存为文本文件(例如称其为test.csv),则应该可以使用Excel,LibreOffice calc等将其作为表打开。使用matlab尝试t = readtable('test.csv');