error using fittype "Undefined function 'fittype' for input arguments of type 'function_handle'."
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I was trying to fit experimental data to the function (y=1/sqrt(x)) but proportionally, i.e. my data graphed similarly so that curves are more or less paralell but with higher y-values in experimental data. So I saw in the posts this solution that I could arrange for one part of my problem (Answer by Sean de Wolski on 21 May 2014 at 15:12) .
x = (1:10).';
y = cumsum(rand(10,1));
% First fit
ft = fittype(@(m,b,x)m.*x+b);
fr = fit(x,y,ft)
% Second fit
ft2 = fittype(@(a,x)a*exp(fr.m*x));
fr2 = fit(x,y,ft2)
Of course the functions I have to fit are different, but when I try this example and also the example adjusted with my data I got in both cases this warning:
Undefined function 'fittype' for input arguments of type 'function_handle'.
So I cannot understand the problem since the example seems to work for other people...Could anyone help me?
Thank you
Patricia
1 comentario
Geoff Hayes
el 19 de Jun. de 2014
Patricia - the function fittype is part of the Curve Fitting Toolbox which you may (or may not) have. In the Command Window type which fittype and observe the results - if you have this function (and so toolbox) the path to this file should be displayed. I don't have this functionality, so when I run this same command I observe 'fit type' not found. You can also type ver to see your version of MATLAB and all toolboxes that have been installed.
Someone else may be aware of an alternative to this function.
Respuestas (0)
Ver también
Categorías
Más información sobre Linear and Nonlinear Regression en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!