how do i save the data from ginput?
Show older comments
This is my script:
% --- Executes on button press in pushbutton5. select finish line function pushbutton5_Callback(hObject, eventdata, handles)
data=[] data(1)=ginput(1); x=data(1){:,1} y=data(1){:,2}
i want to save the x, y points from the ginput, how would i do this?
Answers (1)
Dishant Arora
on 13 May 2014
data = ginput(2);
x = data(:,1);
y = data(:,2);
Or simply:
[x , y] = ginput(2);
5 Comments
Franchesca
on 13 May 2014
Edited: Franchesca
on 13 May 2014
Franchesca
on 13 May 2014
Dishant Arora
on 13 May 2014
"later in the code" , does that mean you want to use it other callbacks, if yes you need to store it in the handles structure:
data = ginput(2);
handles.data = data;
guidata(hobject , handles)
Franchesca
on 13 May 2014
Dishant Arora
on 13 May 2014
data = handles.data;
Categories
Find more on Data Exploration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!