how to write text or character

15 次查看(过去 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 中查找有关 Data Import and Export 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by