The first argument to INPUT must be a character vector.

3 Ansichten (letzte 30 Tage)
Kathy Knight
Kathy Knight am 23 Apr. 2020
Beantwortet: Ameer Hamza am 23 Apr. 2020
x = input("Enter the value for x (inside [-1,1]): ");
if x < -1 || x > 1
disp("Error: the x value is not a valid input")
else
num_dec = input("Enter the number of decimal values desired for accuracy: ");
tol = 1 / (10^num_dec);
end
Not gonna post all of my code yet. first one im getting error pls help and explained why
  2 Kommentare
Geoff Hayes
Geoff Hayes am 23 Apr. 2020
Kathy - which call to input does this error message correspond to? The first, the second, or both? Please copy and paste the full error message to this question. And does your version of MATLAB support double quotes for strings?
Ameer Hamza
Ameer Hamza am 23 Apr. 2020
Which MATLAB Release are you using?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Ameer Hamza
Ameer Hamza am 23 Apr. 2020
You are probably using an older Release of MATLAB, which does not support strings. Try to replace double-quotes with single-quotes.
x = input('Enter the value for x (inside [-1,1]): ');

Kategorien

Mehr zu Entering Commands finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by