Multiple plots in Matlab app designer, with changing values.
조회 수: 7 (최근 30일)
이전 댓글 표시
I want to draw a vertical line over a function, but when I change the vertical line's position using a slider it draws several other lines instead of moving it.
How can I draw multiple plots in app designer that can be changed without it keeping the previous version of the plot ?
댓글 수: 0
채택된 답변
Adam Danz
2020년 5월 4일
편집: Adam Danz
2020년 5월 4일
In the slider callback function, instead of using the same command to plot a new vertical line, update the x value of the vertical line.
persistent verticalLineHandle % or declare the handle as an app property
if isempty(verticalLineHandle)
verticalLineHandle = xline(app.uiaxes, x); % x = slider value, I suppose
else
verticalLineHandle.Value = x; % x = slider value, I suppose
end
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File 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!