Error using ==> fprintf Function is not defined for 'cell' inputs.
Show older comments
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 ;
Accepted Answer
More Answers (0)
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!