How can I solve a set of equations using a function handle?
Mostrar comentarios más antiguos
I have a set of data made up of values between 0 and 1:
biglambda = [ 0.0455 0.0476 0.0500 0.0526 0.0556 0.0588 0.0625 0.0667 0.0714 0.0769 0.0833 0.0909 0.1000
0.1111 0.1250 0.1429 0.1667 0.2000 0.2500 0.3333 0.5000 1.0000]
I want to fit this to a functional form, given by
where a and b are free parameters, t is a time parameter:
t = 1*10^3*[0.5156 0.5693 0.6444 0.6698 0.6730 0.6850 0.8073 0.8615 0.9927 1.0587 1.0791 1.1747 1.1827 1.2286
1.2917 1.2967 1.3735 1.3735 1.3735 1.3924 1.7004 1.9965]
such that each value of biglambda will have its own value of t (in the order shown). T is the time bin, i.e. the time between different values of t. I want to use these parameter sets to find the correct values for a and b that give a suitable fit to the data. My first thought for how to solve this would be to do something of the form
where i is the ith value of biglambda or t, and then minimise this for a and b. However, I'm not sure which is the best approach to take in Matlab for calculating this, as I would normally write a function for
, but as I have a set of values I need to take the sum of this seems to be more complicated. I have started with
for j = 1:length(t)
BigLambdaFunction = @(x)biglambda(j)-(1-x(1)*(x(2)-(t(j)+(t(j+1)-t(j))))/(x(2)-t(j))*exp(x(1)*(t(j+1)-t(j))/x(2)));
end
for each j, but I'm not sure how I can convert this to calculate the whole sum and minimise for x(1) and x(2). What would be a good place to start?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Interpolation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!