Stuck at a command input
显示 更早的评论
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
2021-5-12
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
2021-5-12
Walter Roberson
2021-5-12
Rename your load.m to something else. Change
x = input(prompt)
to
x = input(prompt, 's')
Robert Bag
2021-5-12
Walter Roberson
2021-5-13
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!