How to convert text file to string?

30 ビュー (過去 30 日間)
Maaz Madha
Maaz Madha 2021 年 12 月 8 日
回答済み: Abolfazl Chaman Motlagh 2021 年 12 月 8 日
I have a text file (containing text and not numbers) and I would like to convert it to a string so that it becomes like. I have attached an example file just as a reference
str='ExampleQuestion'

採用された回答

Abolfazl Chaman Motlagh
Abolfazl Chaman Motlagh 2021 年 12 月 8 日
use fscan or fread
F = fopen('Untitled.txt');
Text = fscanf(F,'%c')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by