Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

what can i use in function result instead of shift5?????? it show me error regarding shift5

조회 수: 2 (최근 30일)
Nazi khan
Nazi khan 2016년 10월 22일
마감: MATLAB Answer Bot 2021년 8월 20일
function result = shift5('University') % decodes a message encoded with a Caesar shift % cipher of 5. Assumes message is all upper % case letters.
aVal = double('A'); adjustment = 26; len = length('university'); result = zeros(1,len); temp = ' ';
for ch = 1:len temp = 'university'(ch) - 5; if (temp < aVal) temp = temp + adjustment; end result(ch) = temp; end
result = char(result);

답변 (1개)

Image Analyst
Image Analyst 2016년 10월 22일
Don't put university in quotes. And MATLAB is case sensitive so university is different than University.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by