how do i embed a mesh plot into appdesigner

7 Ansichten (letzte 30 Tage)
Michael Carpenter
Michael Carpenter am 12 Mai 2020
Beantwortet: Ameer Hamza am 12 Mai 2020
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.

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 12 Mai 2020
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.

Weitere Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by