简体   繁体   中英

How to do Curve fitting for a part of data only?

I have a curve from an inverse Fourier transform. The independent variable x runs from 0 to 32 but the dependent variable y is 0 after approaximately 20x10^-3 . So I want to fit a curve only in the part where x is between 0 and 10^-3. I tried the exclude option given in curve fitting toolbox but it did not work. How do I proceed about it?

I would just create variables in your workspace that are in the range of interest and do the fitting with those. Something like:

x_to_fit = x(x>=0 && x<=1e-3);
y_to_fit = y(x>=0 && x<=1e-3);

Then use x_to_fit and y_to_fit in the curve fitting tool to fit your data. See http://www.mathworks.co.uk/help/curvefit/interactive-data-selection.html for more information on data selection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM