简体   繁体   中英

How to save modified data in Curve Fitting Toolbox?

x=[1:.1:10 1000];
y=[1:.1:10 2000];

After reading following values in Curve Fitting Toolbox,
I've removed (1000,2000) as an outlier.

After removing outlier point from Curve Fitting Toolbox (manually using mouse) in MATLAB I wish to save modified x and y values in command window.
I tried saving to workspace but that saves some structure named 'workspace' and 'goodness' but doesn't remove outliers from variable x and y in command window.

I assume you use the Curve Fitting App , which is part of the Curve Fitting Toolbox.

You can achieve what you want as follows:

  1. After fitting the curve, in the app window click File , then Print to Figure . That will produce an independent figure with the plot.
  2. In that figure, click the arrow button, select the fitted line, and then hit Del to remove it.
  3. Now the plot only contains the valid points (black dots) and the outliers (red cross marks). Click on one of the valid points to select it.
  4. The set of valid points is now the current object ( gco ). So, in the command window type

     x = get(gco, 'XData'); y = get(gco, 'YData'); 

    to get the coordinates of valid points in variables x and y .

To read the values of a line in MATLAB (I use 2013b) I often used in code

lin = get(gca, 'Children');
x = get(findall(lin, 'displayName', 'YourName'), 'xData');
y = get(findall(lin, 'displayName', 'YourName'), 'yData');

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