I have a 39x4 cell:
'ID' 'x' 'y' 'z'
459 34 -49 -20
464 36 -38 -22
639 40 -47 -27
719 35 -52 -20
725 42 -45 -18
727 46 -47 -26
...
I would like to write all this to a text file. I've tried the following:
fileID = fopen('test2.txt','w');
formatSpec='%s %d %d %d';
fprintf(fileID,formatSpec,P{:});
fclose(fileID);
However, if I do this, I get the error that fprintf is not defined for 'cell' input. I've seen a couple of examples like this one about how to print a cell array as .txt in Matlab this one about how to write cell array of combined string and numerical input into text file but they don't seem to fit very well without some clunky modifications.
Could someone help?