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

 채택된 답변

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

댓글 수: 4

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

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Entering Commands에 대해 자세히 알아보기

제품

릴리스

R2018a

태그

질문:

2018년 12월 3일

댓글:

2020년 8월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by