how do i make 'Interpreter', 'none' work inside the waitbar text?

조회 수: 39 (최근 30일)
mat
mat 2013년 6월 13일
댓글: Adam Danz 2024년 1월 29일
hi
what is the equivalent for " 'Interpreter', 'none' " in the 'waitbar' framework?
thanks a lot,
matty
  댓글 수: 2
Stefano Monfardini
Stefano Monfardini 2016년 4월 14일
Hi, same question for me
Guillaume
Guillaume 2016년 4월 14일
@Stefano, please ask your own question. That way when it is answered you can accept the answer.
Note that the 2016 answer would not apply to the 2013 version of matlab

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

채택된 답변

Max Snippe
Max Snippe 2017년 12월 30일
Instead of searching for the object one might change the interpreter directly with the 'dot-notation' (available since R2014b) as in the following MWE:
wb = waitbar(0/10,'My_waitbar_string_with_underscores');
wb.Children.Title.Interpreter = 'none';
for i = 1:10
waitbar(i/10,wb,'My_waitbar_string_with_underscores');
pause(1);
end
delete(wb);
Note that if you use a cancel button in the waitbar, the number of children of the object changes and one might have to change
wb.Children.Title.Interpreter
to
wb.Children(2).Title.Interpreter
  댓글 수: 3
David Emerson
David Emerson 2021년 10월 7일
This should definitely be the answer! Worked great for me.
Adam Danz
Adam Danz 2024년 1월 29일
Here's another version that doesn't rely on child order
wb = waitbar(__);
set(gca(wb).Title,'Interpreter','none')

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

추가 답변 (2개)

Orion
Orion 2016년 4월 14일
Hi,
Here's one way to do it
% Create a classic waitbar
h = waitbar(0,'my_name');
% change the interpreter of the String
myString = findall(h,'String','my_name');
set(myString,'Interpreter','none')

mat
mat 2016년 4월 14일
편집: Walter Roberson 2016년 4월 14일
thanks a lot :)
i used th following version:
wb = waitbar(0,'txt');
h=findobj(wb,'Type','figure');
ht = get(get(h,'currentaxes'),'title');
set(ht,'interpreter','none')
matty

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by