Split a string into 4 character groups?
Show older comments
Hello,
I am writing a program as part of my foundation degree which takes messages and encrypts them in a basic way. So far I have used a .txt file encoded in the ASCII format and maniuplated each character to output a single line string based upon the length of the original message:
n=1:length(number_message)
the variable 'number_message' is the output variable in my code. As this string could potentially be any length (n), how can I reliably split this output string into groups of characters for further processing?
My program design is to use multiple layers and I want to group at this stage to deal with the data in groups before moving on to a potential HEX conversion.
I am quite new to Matlab, and coding in general so this may seem like a bit of a strange question and may not make sense.
Kind Regards
_message)
Accepted Answer
More Answers (1)
darren Clipson
on 24 Apr 2021
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!