Do functions like "linkaxes" or "linkprop" work with uifigure in AppDesigner?
11 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2020-5-21
回答: MathWorks Support Team
2020-5-27
When building an app with App Designer, the "linkaxes" and "linkprop" functionalities do not seem to work on "uifigure". Linking axes and their properties helps in obtaining insightful observations. It would be nice if this works.
采纳的回答
MathWorks Support Team
2020-5-21
As of MATLAB R2020a, the "linkaxes" and "linkprop" functionalities are not supported using uifigure in App Designer. Our development team has been notified of this enhancement, and will consider it for future releases of MATLAB.
In the meantime, starting in MATLAB R2020a, you can use regular Axes within App Designer, and both "linkprop" and "linkaxes" are fully supported by regular axes when used within App Designer. Note that, in order to create a regular axes in App Designer, you need to programmatically call the "axes" command. My recommendation is to create a panel in your App while designing your app, and then use that panel as the parent for the axes.
A simple example about how to use regular Axes in an app written in App Designer is as follows:
1. Create a new app.
2. Drag a panel into your app where you want your axes. Set the "Title" to empty to remove the title from the panel. You can also change the border if desired.
3. Add a new property called "Axes", as follows:
properties
Axes matlab.graphics.axis.Axes
end
4. In the "Code View", create a new Callback for the the UIFigure's StartupFcn.
5. Add this code to the new "startupFcn" (please note that both the signature and the end of the function will be generated automatically by App Designer for you)
function startupFcn(app)
app.Axes = axes(app.Panel);
end
You can then use "linkaxes" and "linkprop" on the app.Axes property.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!