Adjust the view of UIAxes

조회 수: 3(최근 30일)
Pelajar UM
Pelajar UM 2022년 5월 30일
댓글: Walter Roberson 2022년 5월 31일
I plot a stl file by pressing a button. Then I rotate it around and change the view. And when I click on the button again, the view goes back to the default position.
I don't want it to go back to the deafult. I want it to use the latest view. But this doesn't work and still goes back to the default:
function ButtonPushed(app, event)
X = get(app.UIAxes,"View");
set ( app.UIAxes,"View", X);
data = stlread ("model.stl");
trisurf (data,'Parent', app.UIAxes);
end

채택된 답변

Walter Roberson
Walter Roberson 2022년 5월 30일
Try
function ButtonPushed(app, event)
X = app.UIAxes.View;
data = stlread ("model.stl");
trisurf (data,'Parent', app.UIAxes);
drawnow;
app.UIAxes.View = X;
end
  댓글 수: 8
Walter Roberson
Walter Roberson 2022년 5월 31일
Oh, that looks useful!

댓글을 달려면 로그인하십시오.

추가 답변(0개)

범주

Find more on Develop Apps Using App Designer in Help Center and File Exchange

태그

Community Treasure Hunt

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

Start Hunting!

Translated by