- If a 'WindowButtonDownFcn' is defined for the figure, it executes before 'waitforbuttonpress' returns a value.
- The 'waitforbuttonpress' function errors if the user closes the figure by clicking the window close button unless your code calls the waitforbuttonpress function within a try/catch block.
Problema con plot di dati, ricevo il messaggio "In workspace belonging to" e la compilazione non procede
조회 수: 1 (최근 30일)
이전 댓글 표시
Ho scritto un codice in cui viene creata una figure tramite un plot e successivamente dentro un ciclo for vado a modificare YData del plot, prima del ciclo for ho messo waitforbuttonpress e quando la compilazione arriva a quel punto del codice nella Command Window compare: "In workspace belonging to (nome del file) ". La compilazione si ferma e non prosegue neanche cliccando sul pulsante Continue.
댓글 수: 0
답변 (1개)
Tushar Sharma
2024년 3월 18일
Hi Giovanni,
It sounds like you're encountering an issue where MATLAB's execution pauses due to 'waitforbuttonpress' and doesn't resume as expected when you interact with the figure or press a button. The behaviour you are describing, particularly the execution not continuing even after pressing "Continue", is not standard and might indicate an issue with how the event is being handled or the expected function's behavior.
Some important points to consider when using 'waitforbuttonpress':
Also, To resume program execution after the 'waitforbuttonpress' function is called, a click or key press must occur in the current figure, and not just any figure. This change in behavior was introduced in order to prevent program execution from proceeding in an unintended figure. Prior to R2014b, 'waitforbuttonpress' would detect a click or key press event in any open figure. The execution stream would then resume in the figure in which the event was detected.
I hope this helps!
댓글 수: 3
Tushar Sharma
2024년 3월 19일
편집: Tushar Sharma
2024년 3월 19일
Can you please share the code snippet here?
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!