Filter löschen
Filter löschen

Selecting two data points form plot

3 Ansichten (letzte 30 Tage)
saravanakumar D
saravanakumar D am 6 Dez. 2019
Bearbeitet: saravanakumar D am 6 Dez. 2019
clear all;
%% Loading the data and assigning the variable
load('_ Mix 0% .mat')
X1=x{1,1};
R1=r{1,1};
P1=phi{1,1};
%% Plotting
figure(1)
subplot(2,1,1)
plot(X1,R1,'LineWidth',2)
subplot(2,1,2)
plot(X1,P1,'LineWidth',2)
%% Selecting the range of data from X1 through clicking the plot using mouse
%[rx,ry]=ginput(2);
[xi,yi] = getpts(X1)
idx1=find(X1==rx(1));
untitled.jpg
My plot looks like above. I would like to truncate the vector such that is contains values from 300 to 600. where as in X1 doesn't contain 300 instead it has 300.2454 . I would like to write a genralized code where I can click on plot to record two data points from X1 (xdata).
[x,y] = getinput(2) returned vales are not from the vector i plotted.
[x,y] = getpts(X1) it is returning vector full of zeros. It should work occording to the manual.
rect = getrect(X1) This one also not working
Somebody please help me.

Antworten (0)

Kategorien

Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by