フィルターのクリア

How do you extract index values from the data tips function into a variable or an array?

33 ビュー (過去 30 日間)
parslee
parslee 2021 年 9 月 28 日
編集済み: Kevin Holly 2023 年 8 月 23 日
I need the index value shown when I select a pixel of my image using the data tips tool.
I need to acquire all the index values of the pixels located within the white square box.
I would record 466.833, 405.573 and so on until I get all the index values of the pixels within the white square box.
Is there a way to extract all the index value data without manually recording them?
  1 件のコメント
Adam Danz
Adam Danz 2021 年 10 月 1 日
If you're looking for a function that extracts data tip info, see getDataTips on the File Exchange.

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

回答 (1 件)

Kevin Holly
Kevin Holly 2021 年 9 月 28 日
編集済み: Kevin Holly 2021 年 9 月 28 日
You can access it as such:
h = gca; %gca stands for get current axes
for i = 1:NumberofDatatips
h.Children.Children(i).Content %The child of the axes is the image and the children of the image are the datatips
end
Would you want to automate this process? If so, prehaps you can combine two functions such as getpts() and datatips().
  2 件のコメント
Mohd Aaquib Khan
Mohd Aaquib Khan 2023 年 8 月 23 日
Hi, NumberofDatatips is not a function right?
Kevin Holly
Kevin Holly 2023 年 8 月 23 日
編集済み: Kevin Holly 2023 年 8 月 23 日

No, it is the total number of datatips. If the only children are datatips, you could acquire the number with

length(h.Children.Children)

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by