Use for-loop on characters in a textfile
이전 댓글 표시
I have a plain text file that is going to be encrypted - where I'll use double as part of the process. I read the text file
text = fileread('textfile.txt')
Then I need to get the letters into numbers
lettertoNumber = double(text)
Now comes the part I'm struggling with. I need to have a for-loop that goes through lettertoNumber, which also needs to take lower/captial letters into consideration.
for ii = 1:length(lettertoNumber)
?? = ???????
?? = ???????
end
Greatly appreciate any input.
댓글 수: 3
Walter Roberson
2018년 9월 18일
What needs to be done inside the for loop? And is it mandatory to use for if it could be done by vectorization ?
Josh Samnja
2018년 9월 18일
Walter Roberson
2018년 9월 18일
double(text) would apply double() to the entire vector of characters individually.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Encryption / Cryptography에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!