提取探空站pwv并存储

    科技2022-08-13  111

    % ①数据提取pwv并存储 clear; clc; year=2018; month=10; b=[];PWV=[];pwv=[]; month_day=7; for day=1:month_day for time=[00,12];%以下将年月日一天的次数数字转为字符串 years=num2str(year); months=num2str(month); days=num2str(day); times=num2str(time); if times=='0'%如果是字符串‘0’,则变为字符串‘00’ times='00'; end name=['seasia_54161_sounding_',years,'_',months,'_',days,'_',times,'.txt']; % 字符串拼接得到文件名称 b=textread(name,'%s');%提取所有字符串并放到b数组内 a = isempty(b);%判断数组b是否为空 if a==1%判断数组b是否为空,若数组b为空则跳出本次循环进入下次循环 continue; else end n=length(b);%计算数组b的长度 pwv=str2num(b{n});%将数组最后一个字符串转成数值型 PWV=[PWV;pwv];%把所有的pwv拼到一个PWV数组内 end end xlswrite('PWV.xlsx',PWV)

     

    Processed: 0.009, SQL: 8