Using input function in compiled application

조회 수: 3 (최근 30일)
michael
michael 2014년 8월 12일
댓글: Harsheel 2014년 8월 13일
I use the input function for user input in a terminal program. Testing in MATLAB is ok, but when i compile the program, the input does not work.
Here a code snippet from my program:
reply = input('be carefull, Nan file will be deleted, do you want to go on? Y/N [N]: ', 's');
if isempty(reply) || strcmpi(reply,'N')
display('program ended by user');
return
elseif ~strcmpi(reply,'Y')
display(['your answer was = ', reply]);
error('input not valid, program terminates');
end
Output in the windows console
The same code in the MATLAB console:
It looks like if the compiled strcmpi function has a problem.
Thanks for your help.
  댓글 수: 1
Harsheel
Harsheel 2014년 8월 13일
I tried the above code in 32-bit MATLAB R2014b and it seems to work fine.
  • Which release and bitness (32 vs 64) of MATLAB are you on?
  • Did you compile the exact same code? I notice an extra line "reply = Y" in your compiled application output.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by