Why does INPUT interpret negative numbers as strings when compiled with MATLAB Compiler 4.0 (R14)?
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre MATLAB Compiler en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!