How can I plot polarplot in AppDesigner?

37 ビュー (過去 30 日間)
Beket
Beket 2023 年 1 月 30 日
回答済み: Cris LaPierre 2023 年 1 月 30 日
Hello, I am making app in Matlab App designer using .m file calculation. In .m file, I wrote polar plot like this:
polarplot(thettar, r)
After that, I have to write and show this in App Designer, but I don't realize how
I tried write like this, but it doesn't work
app.pax = polaraxes(app.UIAxes2);
polarplot(app.pax,thettar,r)

採用された回答

Cris LaPierre
Cris LaPierre 2023 年 1 月 30 日
Take a look at this example app.
Create Axes Programmatically
Some graphics functions plot data on specialized axes. For example, functions that plot polar data must do so on a PolarAxes object. Unlike UIAxes objects, which you can add to your app from the Component Library, you must add specialized axes to your app programmatically in your code. To create an axes object programmatically, create a StartupFcn callback for your app. Within it, call the appropriate graphics function and specify a parent container in your app as the target.
Plot on Polar Axes
Functions such as polarplot, polarhistogram, and polarscatter take a polar axes object as a target. Create a polar axes programmatically by calling the polaraxes function. For example, to plot a polar equation in a panel, first drag a panel component from the Component Library onto your canvas. In the code for your app, create the polar axes object by calling the polaraxes function and specifying the panel as the parent container. Then, plot your equation with the polarplot function, specifying the polar axes as the target axes.
theta = 0:0.01:2*pi;
rho = sin(2*theta).*cos(2*theta);
pax = polaraxes(app.Panel);
polarplot(pax,theta,rho)

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by