Figure unresponsive while waiting for input

Hi,
I have code that requests user input based on a figure that is shown. Unfortunately, the figure is unresponsive while waiting for the input. This shows up in two ways. (1) The figure does not resize when I resize the window and (2) a scroll function that I was programmed for the figure does not work. Once the code is cancelled, it works fine.
Additional information is that I inherited this code for someone who was using an older MATLAB verison. I am on 2016a.
Thanks

댓글 수: 2

Rik
Rik 2021년 12월 20일
How exactly is the input requested?
Yonni f
Yonni f 2021년 12월 20일
x = input('y?');

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

 채택된 답변

Image Analyst
Image Analyst 2021년 12월 20일

0 개 추천

Yes, that's the way it's designed to work. If you tell it to get your input, it waits to get your input and pays attention ONLY to the command line until you enter something. If you want to make adjustments to the GUI, you'd need to make those in advance of calling input().

댓글 수: 6

Or use a different method of asking for input, such as inputdlg()
Yonni f
Yonni f 2021년 12월 20일
Thanks for the suggestions.
This isn't the case for my colleagues who are using the same code on an older version of MATLAB. I think I'm going to make a workaround by using ginput but I'm curious as to why it's behaving differently for me.
Also, inputdlg() has the same behaviour as input()
Yonni, it's a simple matter to put an edit text box on your GUI and just grab the value in it whenever you want. Why not do that? In that case, you can interact with the GUI all you want and not have it wait for you.
Yonni f
Yonni f 2021년 12월 20일
I think that's the correct and most elegant answer, Image Analyst.
Are you using traditional figures (such as with GUIDE), or are you using App Designer?
When I test with inputdlg() and traditional figures, resizing does happen.
Yonni f
Yonni f 2021년 12월 20일
Just normal images, not App Designer. Not sure why it's not working with mine. Maybe a difference in version.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품

릴리스

R2016a

질문:

2021년 12월 20일

댓글:

2021년 12월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by