The first argument to INPUT must be a character vector.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
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?
Antworten (1)
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]): ');
0 Kommentare
Siehe auch
Kategorien
Mehr zu Entering Commands finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!