How to convert text file to string?

조회 수: 32 (최근 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 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