How to convert text file to string?

82 visualizaciones (últimos 30 días)
Maaz Madha
Maaz Madha el 8 de Dic. de 2021
Respondida: Abolfazl Chaman Motlagh el 8 de Dic. de 2021
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'

Respuesta aceptada

Abolfazl Chaman Motlagh
Abolfazl Chaman Motlagh el 8 de Dic. de 2021
use fscan or fread
F = fopen('Untitled.txt');
Text = fscanf(F,'%c')

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by