how do i embed a mesh plot into appdesigner

조회 수: 8 (최근 30일)
Michael Carpenter
Michael Carpenter 2020년 5월 12일
답변: Ameer Hamza 2020년 5월 12일
I am using the following code and have tried many variants in the hopes of getting the app to own it.
[X,Y] = meshgrid(xlin,ylin);
Z = griddata(x,y,z,X,Y,'cubic');
mesh(X,Y,Z)
axis tight;hold on
When run in a matlab "program" it pops a detached window up that has the figure I want.
I want the image to be within the app (Axis?) generated with app designer. I am running R2020a.

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 5월 12일
You need to pass the handle of UIaxes to the graphing functions. For example
[X,Y] = meshgrid(xlin,ylin);
Z = griddata(x,y,z,X,Y,'cubic');
mesh(app.UIAxes,X,Y,Z) % UIAxes is the name of your axes object in app designer. Change it according to your app
axis(app.UIAxes, 'tight');
hold(app.UIAxes);
Also see tha attached app for a demo.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by