When i try to run a program or write sthg in the command line in matlab I just get the same input line over and over again. I deleted the orfiginal file and even restarded matlab. What is wrong?
>> clear
>> whos
>> load
What is the original value? kl
Error using input
Unrecognized function or variable 'kl'.
Error in load (line 3)
x = input(prompt)
What is the original value?
the last one here always comes up

답변 (1개)

Walter Roberson
Walter Roberson 2021년 5월 12일

0 개 추천

You accidentally created your own load.m that is interfering with using MATLAB's load() function.
Also, it appears that you might be expecting the user to enter a character string instead of a numeric value. If that is the case, you should be using the optional second parameter of input(), the 's' option
x = input(prompt, 's')

댓글 수: 4

Robert Bag
Robert Bag 2021년 5월 12일
How can that be fixed? Nothing seem to work.
Rename your load.m to something else. Change
x = input(prompt)
to
x = input(prompt, 's')
Robert Bag
Robert Bag 2021년 5월 12일
Thanks. I did that. Now I am on my way with this code prompt = ('input mat.file: ');
file = input(prompt);
load(file)
whos('-file',file)
disp(
Now all i want it to return only name and size (not class)

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

카테고리

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

질문:

2021년 5월 12일

댓글:

2021년 5월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by