unable to select data-points in a plot

13 ビュー (過去 30 日間)
M K P Dev
M K P Dev 2021 年 7 月 15 日
編集済み: M K P Dev 2021 年 7 月 17 日
I need to programmatically generate a plot in which I need to dynamically select and deselect data points. which I am not able to do using the following code:
y = [2.091666958,1.929444472,1.954580163,1.903415586,1.875379629,1.875379629,1.903415586,1.875379629,1.942330552,1.903415586,1.903415586,1.929750906,1.942330552]'
x = [7.163732175,7.009281649,5.203296758,7.0004477,7.087439702,7,7.012988611,7.002354474,5.274252552,5.38274806,7.000976802,7,5.321121833]'
UIAxes = uiaxes
UIAxes.XGrid = 'on';
UIAxes.YGrid = 'on';
UIAxes.XMinorGrid = 'on';
UIAxes.YMinorGrid = 'on';
UIAxes.YScale='log';
UIAxes.XScale='log';
starting_x = [1 1];
fitfun = fittype(@(a0,a1,x) a0+(a1.*x));
[fitobject,gof,output] = fit(x,y,fitfun,'StartPoint',starting_x);
fig = figure('Visible','off');
ax = axes(fig);
FigHandle = plot(fitobject,x,y,'or');
hApp = copyobj(FigHandle, UIAxes);

回答 (1 件)

Sambit Supriya Dash
Sambit Supriya Dash 2021 年 7 月 15 日
[FDT,ROL] = rmoutliers(y);
OL = y(ROL) % this would be your detected outliers in your dataset (dependent variable)
  1 件のコメント
M K P Dev
M K P Dev 2021 年 7 月 17 日
Thank you sambit for the repy.
It was my mistake that I used the words outliers instead of data points.
The problem is that I need to select datapoints graphically from the generated plot. remove them and replot it.
the removed data points should also be shown but with a cross mark, so that I can once again select them and replot the graph.

サインインしてコメントする。

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by