I keep getting the error "Error using input The first argument to INPUT must be a character vector." What does this mean? I've tried searching for it, yet cannot figure it out.

clc
clear
hello = input("Please enter a number");
switch hello
case 0
disp("You have entered 0");
case 2
disp("Your number is even and prime.");
case (3, 5, 7)
disp("Your number is prime");
otherwise
disp("Invalid number");
end

 Respuesta aceptada

Change the " to '
In your release input() had not yet been extended to handle string objects .

4 comentarios

Thank you. Should I delete this topic now or leave it for others to see?
This help me to but unfortunatily i got an error. undefined function :C
Please post your code and your MATLAB release

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Entering Commands en Centro de ayuda y File Exchange.

Productos

Versión

R2018a

Etiquetas

Preguntada:

el 3 de Dic. de 2018

Comentada:

el 18 de Ag. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by