Error using input Cannot call INPUT from EVALC.
Show older comments
After running the code the correct output is shown in the command window. However, when I try to publish as PDF this error occurs:
Error using input
Cannot call INPUT from EVALC.
Error in LLAB002 (line 48)
numericGrade = input('Enter Numeric Grade(0 to 100): ');
Here is my code
numericGrade = input('Enter Numeric Grade(0 to 100): ');
characterGrade = getCharacterGrade(numericGrade);
fprintf('Grade in Character: %c\n', characterGrade);
function characterGrade = getCharacterGrade(numericGrade)
if numericGrade>=90 && numericGrade<=100
characterGrade = 'A';
elseif numericGrade>=80 && numericGrade<90
characterGrade = 'B';
elseif numericGrade>=70 && numericGrade<80
characterGrade = 'C';
elseif numericGrade>=60 && numericGrade<70
characterGrade = 'D';
else
characterGrade = 'F';
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Language Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!