Reading file data into cell array of character strings -
i'm new matlab. have files conatins list of string like:
abccd hgaq vbser i need read cell array of character strings.
i tried code:
fid2 = fopen('c:\matlab\data\myfile.txt'); tline = fgetl(fid2); while ischar(tline) disp(tline) tline = fgetl(fid2); end fclose(fid2); however, didn't know how convert output cell array of character strings
importdata you:
>> x = importdata('file.txt'); x = 'abccd' 'hgaq' 'vbser' >> whos x name size bytes class attributes x 3x1 364 cell
Comments
Post a Comment