How to convert text file to string?
44 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Maaz Madha
le 8 Déc 2021
Réponse apportée : Abolfazl Chaman Motlagh
le 8 Déc 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'
0 commentaires
Réponse acceptée
Abolfazl Chaman Motlagh
le 8 Déc 2021
use fscan or fread
F = fopen('Untitled.txt');
Text = fscanf(F,'%c')
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Characters and Strings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!