MATLAB的UI轴内部的绘图bode的应用程序设计器
我正在应用应用程序设计器上创建一个UI,我想在我的UI.Axes中绘制一个bode。
此图包含两个图(幅度,相),我想做的是在不同的UI.axes中绘制每个曲线。
我设法使用以下代码绘制幅度bode :
clc;
clear all;
num = [2];
den = [conv([1 1], conv([1 1], [1 1]))];
sys = tf(num, den);
[mag, phase, freq] = bode(sys, {0.1, 100});
bodemag(sys, freq)
h = bodeplot(sys, freq);
setoptions(h,'MagVisible','off');
此代码为我提供了这两个单独的图:
我正在尝试将这些图插入我的应用中的两个不同的UI轴。
有人对如何插入图有一个想法或其他方法吗?
nb:我已经尝试了以下操作: -
- 将代码直接编写到应用程序设计器中,但它会创建 pop up 而不是
- 使用 plot(app.uiaxes,,app.uiaxes, ....,....)功能,但我似乎无法使它起作用
I am creating a UI on app designer and I want to plot a bode in my UI.axes.
This figure contains two plots (magnitude, phase) and what I want to do is to plot each plot in different ui.axes.
I've managed to plot only the magnitude bode and the phase bode using the following code :
clc;
clear all;
num = [2];
den = [conv([1 1], conv([1 1], [1 1]))];
sys = tf(num, den);
[mag, phase, freq] = bode(sys, {0.1, 100});
bodemag(sys, freq)
h = bodeplot(sys, freq);
setoptions(h,'MagVisible','off');
This code gives me these two seperate plots :
I am trying to insert these plots in two different ui axes in my app.
Does any one have an idea or another approach on how to insert the plots ?
NB : I've tried the following :-
- Writing the code direcly into the app designer but it creates a pop up instead
- Using the plot(app.UiAxes, ...., ....) function but I can't seem to make it work
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过app.uiaxes从appDesigner显示代码吗?
您使用哪种MATLAB Realease?
据我所知,在较旧版本的UIAXES中不支持子图。因此,您必须制作两个uiaxes或使用较新版本。
如果将代码直接写入AppDesigner,则将创建轴。 UIAXES和轴对象之间存在差异。如果要使用轴,则必须设置更多的属性,以使其在应用程序的Uifigure内部显示。
你尝试过吗?
我不知道UIAXES是否支持BODEMAG功能。如果不适合uiaxes,这可能是有道理的。
如果UIAXES不支持BODEMAG,则必须使用正常轴进行编码并编码此轴的位置。
这是一个很好的示例。 “ nofollow noreferrer”> https://de.mathworks.com/help/matlab/creating_guis/polar-plotting-plotting-plotting-plotting-gui-in-app-designer.html
,这是需要附加的部分。
Can you show your code from appdesigner with the app.UIAxes.
Which Matlab realease do you use ?
As i know subplots are not supported in a UIAxes in older versions. So you have to make two UIAxes or use newer version.
If you write your code directly to appdesigner you are creating an Axes. There is an difference between UIAxes and Axes object. If you want to use Axes you have to set more properties to make it display inside your UIFigure of your App.
You tried this ?
I don't know if the UIAxes supports bodemag function. This could make sense, if it doesn't work with UIAxes.
If UIAxes doesn't support bodemag then you have to do it with normal axes and code the positioning of this axes.
This is a good example how to do it.: https://de.mathworks.com/help/matlab/creating_guis/polar-plotting-app-gui-in-app-designer.html
And this is the part that is required additional.
appdesigner中的bode
bode in appdesigner