The following code works in older versions (prior to 2014b) but not anymore.
data= rand (100,1);
figure;
plot(data);
hold off
zoom on
h=zoom;
set(h,'Motion','horizontal','Enable','on');
waitfor(gcf,'CurrentCharacter',13) % code
zoom reset
[points,~]=ginput(1);
close
The error I get it in 2014b is:
"Error using waitfor Value must be a char."
This doesn't happen in the previous versions of matlab I have use 2010-2013
What is different in 2014b? Any help would be appreciated. Cheers

 채택된 답변

SB
SB 2014년 10월 29일

0 개 추천

I FIGURED IT OUT
In previous versions this code works fine
data= rand (100,1);
figure;
plot(data);
hold off
zoom on
h=zoom;
set(h,'Motion','horizontal','Enable','on');
waitfor(gcf,'CurrentCharacter',13)
zoom reset
[points,~]=ginput(1);
close
However in 2014 this will work
data= rand (100,1);
figure;
plot(data);
hold off
zoom on
h=zoom;
set(h,'Motion','horizontal','Enable','on');
waitfor(gcf,'CurrentCharacter',char(13))
zoom reset
[points,~]=ginput(1);
close
With the important difference being waitfor(gcf,'CurrentCharacter', char(13) )
I don't know why but I got it to work..

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

질문:

SB
2014년 10월 29일

답변:

SB
2014년 10월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by