GUI axes question, need help having a minimal and maximal edit box for the x axes values

조회 수: 2 (최근 30일)
How would I be able to change the value of the x axes in a GUI for a plot using two edit boxes-a minimal x value box and a maximal x value box?

채택된 답변

Rik
Rik 2019년 7월 21일
Set the XLim property of the axes object in a callback.
Make sure not to forget to use str2double, to check for NaN input, to insert default values for missing fields, and to make sure that the max is larger than the min.
  댓글 수: 2
Caitlin Schmidt
Caitlin Schmidt 2019년 7월 21일
Could you provide an example? i have never used the XLim property before and am wondering how I should be implementing it. Thank you!
Rik
Rik 2019년 7월 21일

You can use something like this:

h=guidata(hObject);
set(h.axes1,'XLim', [1 9])

Does that help?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by