How to understand the third output of 'ginput
1 view (last 30 days)
Show older comments
MathWorks Support Team
on 30 Jan 2017
Edited: MathWorks Support Team
on 4 Mar 2021
Why does the third output of 'ginput' always default to a value of 1? Further, why is the third output empty when 'Return' is pressed?
Accepted Answer
MathWorks Support Team
on 4 Mar 2021
Edited: MathWorks Support Team
on 4 Mar 2021
The documentation (linked below) states that “button is a vector of integers indicating which mouse buttons you pressed (1 for left, 2 for middle, 3 for right), or ASCII numbers indicating which keys on the keyboard you pressed”. Therefore the third output should only be 1 when you use the left click to select the point.
The third output should be empty only when you hit "Return" before clicking on any points as stated in the documentation because no points were chosen.
0 Comments
More Answers (0)
See Also
Categories
Find more on Visual Exploration in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!