There's an error using input function in my computer , how do I solve it?

clear all;
close all;
clc;
name=input('Enter your name:','s')
surname=input('Enter your surname:','s')
location=input('Enter your current location:','s')
fprintf('My name is %s%6s and I am currently in %s\n',name,surname,location)

댓글 수: 3

Stephen23
Stephen23 2018년 3월 19일
편집: Stephen23 2018년 3월 19일
"There's an error using input function in my computer , how do I solve it?"
I don't get any error when I run that code. What error do you get? Please give the complete error message. This means all of the red text.
I got this error even after i reinstalled MATLAB

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

 채택된 답변

Stephen23
Stephen23 2018년 3월 19일
편집: Stephen23 2018년 3월 19일

0 개 추천

The error message is telling you that you have a file named input: have a look at the second line of the error message: what does it say? Change the name of the file to something else.
Tip: always use which to check if a name is in use.

추가 답변 (1개)

Image Analyst
Image Analyst 2018년 3월 19일

0 개 추천

print is a built-in function, so it is not a good idea to call your m-file print.m. Rename the file and see if that fixes it.

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

질문:

2018년 3월 19일

편집:

2018년 3월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by