Complied code not working
显示 更早的评论
I have a matlab function that works fine inside the matlab environment, but gives an error message when run as a compiled program. Below is a code snippit about the location of the error message;
City = 'A';
while (City ~= 'W') && (City ~= 'L')
City = input('Enter ''W'' for Wellington, ''L'' for Lower Hutt > ', 's');
City = upper(City);
end; % while
The following is the error message when run in a Windows (Win 7 64 bit) shell;
Enter 'W' for Wellington, 'L' for Lower Hutt > W
Operands to the || and && operators must be convertible to logical scalar values
.
Error in erosionimages (line 91)
MATLAB:nonLogicalConditional
Clearly the boolean condition is okay when first entering the while loop (otherwise I'd never get to the input line). I get the same result if I enter 'w', 'W', or 'x'. Line 91 is the end statement.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!