how save diplayed data?
1 次查看(过去 30 天)
显示 更早的评论
hi,
i have the following code:
fid=fopen('webscopG.txt');
for j=1:100000
tline = fgetl(fid);
i=i+1;
if ~ischar(tline), break, end
disp(tline);
end
fclose(fid);
this code will display tline as array, and that what I need . But how I can save this array of tline.
thanks
2 个评论
采纳的回答
Walter Roberson
2012-4-6
If you are unable to modify that source, then consider the diary command, or consider executing that source within evalc() and writing out the characters you get back from evalc().
Much better would be to follow IA's suggestion of writing to a file within the loop itself. fopen(), fprintf(), eventually fclose()
6 个评论
更多回答(2 个)
Thijs
2012-4-6
fid=fopen('webscopG.txt');
for j=1:100000
tline{i} = fgetl(fid);
i=i+1;
if ~ischar(tline),
break,
end
disp(tline);
end fclose(fid);
does that work?
1 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!