How can I plot polarplot in AppDesigner?

조회 수: 45 (최근 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 CenterFile Exchange에서 Polar Plots에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by