# How do I write a number and Letter in the same line?

조회 수: 11(최근 30일)
Elijah McNeil 2020년 10월 28일
댓글: Elijah McNeil 2020년 10월 28일
values = {'Enter a value that is equal to or greater than 0 but equal to or less than 100:','Enter a 2nd value that is equal to or greater than 0 but equal to or less than 100:'};
values = inputdlg(values)
values = str2double(values)
n = mean(values)
if n >= 91
elseif n >= 81
elseif n >= 71
elseif n >= 61
else
end
k = n + grade
disp(k)
I need to write n and grade on the same line, but when this runs, instead of displaying the value of n, it displays a seemingly random symbol or number with the grade letter attached.
example: If I enter 88 & 67 it makes k = 'MC', the values 100 & 20 make k = '<F'.

댓글을 달려면 로그인하십시오.

### 채택된 답변

You can use:
##### 댓글 수: 1표시숨기기 없음
Elijah McNeil 2020년 10월 28일
That worked! Thank you so much!

댓글을 달려면 로그인하십시오.

### Community Treasure Hunt

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

Start Hunting!