How to convert text file to string?

32 次查看(过去 30 天)
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
use fscan or fread
F = fopen('Untitled.txt');
Text = fscanf(F,'%c')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by