Surf not plotting in App Designer

조회 수: 13 (최근 30일)
EGD
EGD 2019년 5월 8일
답변: EGD 2019년 5월 10일
I am trying to plot a matrix in three dimensions in App Designer using the surf plot function. The issue is the code works just fine on my computer but is not working on my boss's. I have a mac and am running version R2018a update 6 (and the plot works), the other computer is not a mac (but runs windows) and is running a pre-release version of R2018a (this is when it does not work). I should note that I also had a friend with a computer that runs windows who is also running R2018a update 6 try running the program and he experienced no issues. Below is the code:
1) surf(x100,zz,ysurf)
2) surf(app.UIAxes2,x100,zz,ysurf)
3) rotate3d(app.UIAxes2,'on')
4) app.UIAxes2.XLim = [-app.xlim app.xlim];
Line 1 was added as a test measure and on my computer this code graphs the plot correctly on the axis in app designer as it should via line 2 AND plots the graph in a separate figure window as it should via line 1. The other computer only displays the graph in the seperate figure window BUT NOT on the axis in the app. Has anyone had this problem with older versions of R2018a? Or have any other ideas as to what might be happening?

채택된 답변

Stephane Dauvillier
Stephane Dauvillier 2019년 5월 9일
On the first versions of appdesigner, 3D graph wasn't supported. But it is now.
Try to avoir this kind of call with any UI:
visualizefunction(data)
As it will visualize you data on the current axes which can be anything (the last created one or the last one selected by user by clicking on it).
Instead always specify in which axis you want these data to be visualized
visualizefunction(axes,data)
I'm on windows and it works perfectly for me

추가 답변 (1개)

EGD
EGD 2019년 5월 10일
We updated to R2019a and the problem was resolved

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by