I am receiving an error with MATLAB and I have absolutely no idea why.
MATLAB Version is R2018a.

4 件のコメント

Stephen23
Stephen23 2020 年 9 月 11 日
This will show you why:
which input -all
Jayesh Kamboj
Jayesh Kamboj 2020 年 9 月 11 日
I've found a script called input.m, but what am I supposed to do with it? I don't quite understand.
Jayesh Kamboj
Jayesh Kamboj 2020 年 9 月 11 日
K never mind I fixed it. Turns out I DID have a function called input already.
Dr. Kelsey Joy
Dr. Kelsey Joy 2021 年 11 月 27 日
It's so easy to accidentally create a script file or variable with an existing MATLAB function name. The worse I have ever seen was a student create a created a script file called "edit". Geez that took a LONG time to figure out! lol.

サインインしてコメントする。

 採用された回答

madhan ravi
madhan ravi 2020 年 9 月 11 日

0 投票

You have a custom made function named input() which shadows the inbuilt function. Rename it or remove it from the path.

7 件のコメント

Jayesh Kamboj
Jayesh Kamboj 2020 年 9 月 11 日
編集済み: Jayesh Kamboj 2020 年 9 月 11 日
I don't have any function named input. I had one called 'input_lab2_ex3' but I changed that to 'inpu_lab2_ex3'. I am still receiving the same error.
madhan ravi
madhan ravi 2020 年 9 月 11 日
What does Stephen comment output? Paste the output , so we can analyse.
Jayesh Kamboj
Jayesh Kamboj 2020 年 9 月 11 日
I clicked on the program, and this is what I found:
%INPUT Prompt for user input.
% RESULT = INPUT(PROMPT) displays the PROMPT string on the screen, waits
% for input from the keyboard, evaluates any expressions in the input,
% and returns the value in RESULT. To evaluate expressions, INPUT accesses
% variables in the current workspace. If you press the return key without
% entering anything, INPUT returns an empty matrix.
%
% STR = INPUT(PROMPT,'s') returns the entered text as a MATLAB string,
% without evaluating expressions.
%
% To create a prompt that spans several lines, use '\n' to indicate each
% new line. To include a backslash ('\') in the prompt, use '\\'.
%
% Example:
%
% reply = input('Do you want more? Y/N [Y]:','s');
% if isempty(reply)
% reply = 'Y';
% end
%
% See also KEYBOARD.
% Copyright 1984-2011 The MathWorks, Inc.
% Built-in function.
madhan ravi
madhan ravi 2020 年 9 月 11 日
That’s NOT the OUTPUT of STEPHEN’S COMMENT.
Jayesh Kamboj
Jayesh Kamboj 2020 年 9 月 11 日
K never mind I fixed it. Turns out I DID have a function called input already.
Jayesh Kamboj
Jayesh Kamboj 2020 年 9 月 11 日
and output was 'built-in (C:\Program Files\MATLAB\R2018a\toolbox\matlab\lang\input)'
madhan ravi
madhan ravi 2020 年 9 月 11 日
LOL

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDesktop についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by