Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Array containing place of char in alphabet from string:
- name = 'patzzz'
- length = numel(name)%gives 3 here
- for n = 1:length
- numberarray(n) = [(double(name(n))-96)]
- end%populates array with alphabetic place of characters in name
- %this gives: [16 1 20]
- for n = 1:length
- numberarray(n) = numberarray(n)+n
- if numberarray(n)+n >=26
- numberarray(n)+n-26
- end
- end %for some reason this for loop prints numberarray 3 times (not necessary)
- enc = char(numberarray+96) %prints encrypted form of 'pat' - qcw, still no wrap function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement