How to load all the text into the variable
2 次查看(过去 30 天)
显示 更早的评论
Hello. I have a problem. I write small program to encrypt/decrypt. When I enter text into a variable (from keyboard) I can't make paragraphs, because in this case only the first paragraph is saved in the variable. Any ideas?
prompt = 'Please input your text ';
plaintext1 = input(prompt,'s');
0 个评论
采纳的回答
Ameer Hamza
2020-4-29
If you want to read several paragraphs, then reading from a file might be a better option: https://www.mathworks.com/help/releases/R2020a/matlab/ref/fileread.html
However, If you still want to interactively ask the user for input, the uitextarea: https://www.mathworks.com/help/releases/R2020a/matlab/ref/uitextarea.html is a better choice for a multiple paragraph text.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!