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