Use imdistline function in App Designer

8 ビュー (過去 30 日間)
Jake Manning
Jake Manning 2019 年 9 月 19 日
編集済み: Jake Manning 2019 年 9 月 24 日
I am porting over code from an app created in GUIDE to App Designer and I want to add functionality to be able to interactively draw a line over my image being displayed in an UIAxis object and label the distance. Outside of app designer this can be done with the imdistline function, unfortunately it relies on UIContextMenu, which is not supported within app designer. Any ideas how I could recreate this behavior within the app designer environment?

回答 (1 件)

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi 2019 年 9 月 24 日
There might not be an exact function but you can use the following workaround to replicate its behavior.
After displaying the image you can use ginput or enable datacursormode to get the co-ordinates of the points between which you want to calculate the distance. You can then find the distance between those points using Euclidean formula and display it using ‘annotation’.
The following links might be helpful.
Hope this helps!

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by