Error using gamfit . X must be non-negative.
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
clear;clc
%hist = 'access05_indo_daily.txt'; % as x
%obs = 'chirps05_indo_daily.txt'; % as y
hist = 'hfeb_.txt'; % as x
obs = 'ofeb.txt'; % as y
delimiterIn = ' ';
%headerlinesIn = 1;
x = importdata(hist);
y = importdata(obs);
[m,n] = size(y);
ycor = zeros(m,n);
%cpolys = zeros(n,4);
xi = x(:,4);
yi = y(:,4);
yi(yi<=0) = 0;
Pxi = gamfit(xi);
Pyi = gamfit(yi(~isnan(yi)));
xgrid = linspace(0,1,101);
xinv = gaminv(xgrid,Pxi(1),Pxi(2)); xinv = xinv(1:100); % nilai ke 101 biasanya infinite value, jadi harus dibuang
yinv = gaminv(xgrid,Pyi(1),Pyi(2)); yinv = yinv(1:100); % nilai ke 101 biasanya infinite value, jadi harus dibuang
cpoly = polyfit(xinv,yinv,4);
%cpolys(i,:) = cpoly;
Réponses (0)
Voir également
Catégories
En savoir plus sur Particle & Nuclear Physics dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!