MATLAB: Problem in saving array in txt file

text file

hi, I want to save this array in file but I did not get what I want
ex.
x={'RCIN' 'AFGN' 'RGGA';'RCIN' 'RQDM' 'RGGA'};
in fact my data is more larger, but are of this type.
when run this code:
outfid=fopen('web.txt','wt');
for i=1:2
for j=1:3
fprintf(outfid, '%c ',x{i,j} );
end
fprintf(outfid,'\n' );
end
I get web.txt as
R C I N A F G N R G G A
R C I N R Q D M R G G A
But I need it as in array: 'RCIN' 'AFGN'…….
please, who can help me , I suffered from this problem since long time
thanks in advance, huda

Best Answer

'%c' is single chracter. Try '%s'.