Error: Function value and YDATA sizes are not equal
Afficher commentaires plus anciens
I have a fitting code with lsqcurvefit function. I am having this error "Function value and YDATA sizes are not equal"(line 251). Please give your suggestion to solve it.
clear all, close all, clc
EQE = xlsread('EQERollOff','Sheet1','A30:B55');% loading raw data from excel file
x = EQE(:,1);% Current
y = EQE(:,2);% EQE
%parameter estimation
J0 = [6];
options = optimset('Algorithm', 'trust-region-reflective');
[J,Rsdnrm,Rsd,ExFlg,OptmInfo,Lmda,Jmat] = lsqcurvefit(@EQEFit,J0,x,y)
function s = EQEFit(J,x)% function for fitting
s = J(1)/(4*x)*(sqrt(1+8*(x/J(1)))-1)*5
end
Size of x = 26 1, Size of y = 26 1
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Get Started with Curve Fitting Toolbox 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!