Select with the cursor in a plot the interval boundaries

11 ビュー (過去 30 日間)
Tom Bedkowski
Tom Bedkowski 2019 年 8 月 1 日
回答済み: Tom Bedkowski 2019 年 8 月 6 日
Hello,
is there any opportunity to choose with the cursor in a plot points to define variables.
I want to select with two cursor klicks on a plotted signal an interval for further analysis.
Thank you for help!

回答 (2 件)

Samatha Aleti
Samatha Aleti 2019 年 8 月 5 日
You can select the points on the plot and save it to workspace with a variable name. One of the ways to do this is to select “Data Tips” option, then select the data points to be saved. Now right click anywhere on the figure and select “Export Cursor Data to Workspace” and give a variable name.
Data Tips >> select data points >> right click >> Export Cursor Data to Workspace
To add data points to existing variable, right click and select “Create New Data Tip” then repeat above process.
Refer the figures attached for better understanding.
  2 件のコメント
Tom Bedkowski
Tom Bedkowski 2019 年 8 月 5 日
Thank you it works but i need an other solution for my problem.
Like this ...
datacursormode on;
dcm_obj = datacursormode(H);
pause
[c_info] = getCursorInfo(dcm_obj);
index1=c_info(1,1).DataIndex;
index2=c_info(1,2).DataIndex;
posi1=c_info(1,1).Position;
posi2=c_info(1,2).Position;
Tom Bedkowski
Tom Bedkowski 2019 年 8 月 5 日
編集済み: Tom Bedkowski 2019 年 8 月 6 日
But it is a little bit unconfortable to set the points, which informations i want to know.
Is there any other solution for this problem.
Maybe with a rectangular which i stretch over my signalplot.

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


Tom Bedkowski
Tom Bedkowski 2019 年 8 月 6 日
I got it what i want.
xdata = 1:10;
ydata = rand(1,10);
plot(xdata, ydata)
[x, y] = ginput(2)
inpolygon(xdata, ydata, x([1 2 2 1]), y([1 1 2 2]))

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by