filename='sotaventogaliciaanual.xlsx'; sheet=1; xlRange='B2:B52129'; velocidad=xlsread(filename,sheet,xlRange); x=0.5:1:max(velocidad); prom=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=[prom destd^2]; af=nlinfit(x,frec,f,a0); k=af(1); c=af(2); fprintf('Parámetros Weibull:k-%1.4f, c=%1.4f\n',k,c) pot=xlsread('sotavento_curva potencia.xlsx'); x=0:0.1:25; yi=interpl(pot(:,1),pot(:,2),x,'pchip'); 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('La potencia media es: %3.1f\n', power) x=linspace(0,max(velocidad),100); y=f(af,x); figure; plot(x,y,'r')
f = function_handle with value: @(a,x)(a(1)/a(2))*((x/a(2)).^(a(1)-1)).*exp(-(x/a(2)).^a(1)) Parámetros Weibull:k-2.3849, c=6.0208
Undefined function 'interpl' for input arguments of type 'double'. Error in Ej2b (line 21) yi=interpl(pot(:,1),pot(:,2),x,'pchip');