how to write text or character

조회 수: 4 (최근 30일)
nkumar
nkumar 2014년 10월 14일
편집: Orion 2014년 10월 14일
I have a array
stop={'a', 'about', 'above', 'the'};
I want to write this to a text file like
a about above the
or
a about above the
i tried many commands like fwrite,fprintf,dlmwrite,but could not get like this
kindly assist

채택된 답변

Orion
Orion 2014년 10월 14일
편집: Orion 2014년 10월 14일
Hi,
you want something like :
stop={'a', 'about', 'above', 'the'};
fid = fopen('MyFile.txt','wt');
for i = 1:length(stop)
fprintf(fid,'%s ',stop{i});
end
fclose(fid);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by