filename='sotaventogaliciaanual.xlsx';
sheet=1;
xlRange='B2:B52129'
velocidad=xlsread(filename,sheet,xlRange);
x=0.5:1:max(velocidad);
promedio=mean(velocidad);
destd=std(velocidad);
interv=hist(velocidad,x);
frec=interv/sum(interv);
f=@(a,x) (a(1)/a(2))*((x/a(2)).^(a(1)-1)).*exp(-(x/a(2)).^a(1))
a0=[promedio destd^2]
af=nlinfit(x,frec,f,a0);
k=af(1);
c=af(2);
fprintf('parametros Weibull: k-%1.4f,c-%1.4f\n',k,c)
filename2='sotavento_curva.xlsx';
sheet=1;
xlRange='B2:B52129'
pot=xlread(filename2,sheet,xlRange);
funo=@(x) (k/c)*((x/c).^(k-1).*exp(-x/c).^k);
h=@(x) funo(x).*interpl(pot(:,1),pot(:,2),x,'pchip')
power=quad(h,0,25);
fprintf('Potencia Media:%3.1f\',power)
x=linspace(0,max(velocidad),100);
yf(af,x);
figure
plot(x,y,'r')
xlRange =
B2:B52129
f =
@(a,x)(a(1)/a(2))*((x/a(2)).^(a(1)-1)).*exp(-(x/a(2)).^a(1))
a0 =
5.5374 7.2084
parametros Weibull: k-2.3849,c-6.0208
xlRange =
B2:B52129
Undefined function 'xlread' for input arguments of type 'char'.
Error in EJER2BC (line 26)
pot=xlread(filename2,sheet,xlRange);