Filter löschen
Filter löschen

I'm trying to display a pdegplot graph in appdesigner, but I have no idea how to get it do display using app.UIAxes. My code is below

2 Ansichten (letzte 30 Tage)
model = createpde;
gm = importGeometry(model,'ADCS.stl');
pdegplot(gm);

Antworten (2)

Cameron
Cameron am 30 Dez. 2022
All you have to do is put your uiaxes as the first arguement. For you, it would likely just be pdegplot(app.UIAxes,gm). Here's another example
%the code below is taken from the documation here:
%https://www.mathworks.com/help/pde/ug/pdegplot.html?s_tid=doc_ta
g = [2 1 1 1 1 1 1 1 1 4 4;
-1 -0.6 -0.5 -0.4 -0.5 0.4 0.5 0.6 0.5 -1 0.17;
1 -0.5 -0.4 -0.5 -0.6 0.5 0.6 0.5 0.4 0.17 1;
0 -0.25 -0.35 -0.25 -0.15 -0.25 -0.35 -0.25 -0.15 0 -0.74;
0 -0.35 -0.25 -0.15 -0.25 -0.35 -0.25 -0.15 -0.25 -0.74 0;
0 0 0 0 0 0 0 0 0 1 1;
1 1 1 1 1 1 1 1 1 0 0;
0 -0.5 -0.5 -0.5 -0.5 0.5 0.5 0.5 0.5 0 0;
0 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 0 0;
0 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 1 1;
0 0 0 0 0 0 0 0 0 0.75 0.75;
0 0 0 0 0 0 0 0 0 0 0];
pdegplot(app.UIAxes,g)
  1 Kommentar
Mjganji
Mjganji am 15 Feb. 2023
Bearbeitet: Mjganji am 15 Feb. 2023
I've got a syntax error with "pdegplot(app.UIAxes,g)" by:
Error using pdegplot
Expected a string scalar or character vector for the parameter name.
Is there any way to call a figure in app designer and then we write "pdegplot(g)" so it would draw in that specific figure? (like in script, "figure(F1)")

Melden Sie sich an, um zu kommentieren.


mi li
mi li am 6 Jun. 2023
I find a solution,we can copy the date of pdegplot() to app.UIAxes:
pdegplot(model);%偏微分方程求解
hFig = gcf; % 获取当前图形窗口的句柄
hAx = gca; % 获取当前坐标系的句柄
% 复制绘图对象到 app.UIAxes
copyobj(allchild(hAx), app.UIAxes);
% ylim(app.UIAxes, [-80, 0]);
% xlim(app.UIAxes, [-80, 250]);
% zlim(app.UIAxes, [-80, 80]);
view(app.UIAxes,15,25);
% 关闭图形窗口
close(hFig);

Community Treasure Hunt

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

Start Hunting!

Translated by