My vectors appear to be the same length but I am still getting error for plot
Afficher commentaires plus anciens
Hi there, I am trying to do an iterative and random sampling best fit plot. I keep getting error, saying that "vectors must be the same length. My mat1 is 38 x 2, RP1 is 38 x 1 and Dmge is 38 x 1. Any suggestions
mat1 = [Dmge RP1];
for ii=1:10
b = randsample(1:38,35);
A= 5500; B=0.19; C=2.3;
goemp_fit1 = @(y)sum((y(1)*exp(-exp(-y(2)*(x(1,:)-y(3))))-x(2,:)).^2);
coeff = fminsearch(goemp_fit1,[A B C]);
A = coeff(1);
B = coeff(2);
C = coeff(3);
y2 = A*exp(-exp(-B*(RP1-C)));
y2_tp = transpose(y2);
plot(mat1(b,2),y2,'-','Color',mcolour(ii,:))
xlabel('Flow3');
ylabel('Damage ($000USD)');
title('Damage v Flow3');
end
3 commentaires
madhan ravi
le 14 Sep 2018
Can you provide the mat1 details?
Naveed Hossain
le 15 Sep 2018
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Time Series Events dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!