Error using ==> fprintf Function is not defined for 'cell' inputs.
古いコメントを表示
Can anyone point out what's wrong with my code? I'm trying to print information to a file with fprintf. I keep getting the error: "Error using ==> fprintf Function is not defined for 'cell' inputs."
fid= fopen('conf1.txt');
fid1=fopen('conf.txt');
fid2=fopen('new_conf.txt','w');
N = 2703;
A = textscan(fid, '%d %s %s %d %f %f %f', N, 'headerlines', 2);
C = textscan(fid1, '%d %s %s %d %f %f %f %f %f %f', N, 'headerlines', 2);
for i = 1:2703
fprintf(fid2,'%5d%5s%5s%5d%8.3f%8.3f%8.3f%8.4f%8.4f%8.4f \r\n', C{1}(i), C{2}(i), C{3}(i), C{4}(i), A{5}(i), A{6}(i),A{7}(i),C{8}(i),C{9}(i),C{10}(i));
end
fclose all ;
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!