Error using input Cannot call INPUT from EVALC.
显示 更早的评论
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
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Language Fundamentals 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!