Why does INPUT interpret negative numbers as strings when compiled with MATLAB Compiler 4.0 (R14)?
Show older comments
I used INPUT to prompt the user for arguments to pass into my function. When run inside MATLAB, both positive numbers and negative numbers are interpreted as double-precision matrices inside of the function. However, when I compile the function and run it in stand-alone mode, positive numbers are interpreted as matrices, but negative numbers are interpreted as strings. The following function reproduces this behavior:
function inputtest
y=input('Enter a number: ');
if ischar(y)
disp('Number interpreted as string');
elseif isnumeric(y)
disp('Number interpreted as matrix');
end
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!