风力发电机功率曲线统计MATLAB代码实现function[windspeed_avractive_power_devwindspeed_fin_avractive_power_fin_avrCP]=Powercurve-caLv03(filenamelzfilename2Jilename3zfilename4)%读取excel的xls×文件%B列为功率C列为风速datal=xlsread(filenamelzlz,B2ιC52000');data2=xlsread(filename2zlz,B2ιC52000');data3=xlsread(filename3zl∕'B2ιC52000');data4=xlsread(filename4zl∕'B2ιC52000,);%将四个Excel表合成一个表格data=[datal;data2;data3;data4];%对数据进行筛选风速<3m∕s功率COkw的数据不要n=length(data(ιz2));forj=l:l:nifdata(j,2)>=3&&data(j,l)>=lθdata-opt(jzl)=data(jz2);data_opt(j,2)=data(j,l);endend%对风速和功率进行排序并返回索引%求0.5m∕s的时间间隔的平均风速和相对应的平均功率,标准差m=length(ind);k=O;u=0;h=0;windspeed_sum=O;active_power_sum=0;windspeed_avr=O;active_power_avr=0;active_power_error_sum=0;windspeed_fin_sum=O;active_power_fin_sum=0;P=1.062;A=pi*(88∕2)^2;forwindspeed_num=3:0.5:19.5fori=l:l:m%初步计算平均风速和平均功率active_power(i)=data_opt(ind(i),2);ifwindspeed(i)>=windspeed-num&&windspeed(i)=windspeed-num&&windspeed(i)=windspeed-num&&windspeed(i)