How to load all the text into the variable

2 ビュー (過去 30 日間)
Darek Myszk
Darek Myszk 2020 年 4 月 29 日
回答済み: Ameer Hamza 2020 年 4 月 29 日
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');

採用された回答

Ameer Hamza
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 件)

カテゴリ

Help Center および File ExchangeText Analytics Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by