How to limit data from a fit?
26 次查看(过去 30 天)
显示 更早的评论
I have a custom fit that fits data that I've plotted. I now want to try to limit the range in which the fit occurs. I want it to limit where x is less than 150.
Here is my current code:
rho=Resistivityohmcm;
T=TemperatureK;
plot(T,rho,'-o')
x=T;
y=rho;
fnPolySq=@(p1,p2,x) p1*x.^2 + p2;
fit(x,y,fnPolySq)
plot(f,T,rho)
disp (f)
0 个评论
采纳的回答
更多回答(1 个)
Aquatris
2018-7-24
Create new variables;
range = find(x<150);
xNew = x(range)
yNew = y(range)
Obtain your fit using xNew and yNew variables instead of x and y.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Curve Fitting Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!