How can I change the value of a text field based on plot selection in MATLAB APP Designer?

20 ビュー (過去 30 日間)
Christian Garcia
Christian Garcia 2022 年 4 月 11 日
回答済み: Kevin Holly 2022 年 4 月 12 日
I have multiple tests with similar data I am plotting against one another.
Is it possible for me to get MATLAB APP Designer to populate a text field with test details based on the plot I click on or hover my mouse over?
I am using RMATLAB 2021b

回答 (1 件)

Kevin Holly
Kevin Holly 2022 年 4 月 12 日
Christian,
Please see the app attached.
You could create a callback function to the Axes by right clicking >Callbacks>Add UIAxesButtonDown callback.
In the example below (and app attached), I took the string from the axes title and place it in the edit field and label.
function UIAxesButtonDown(app, event)
app.EditField.Value = app.UIAxes.Title.String; % For edit field
app.Label.Text = app.UIAxes.Title.String; %For label
end

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by