function []=printresults2file(shape)fid=fopen('ChangyuLiu.txt','wt');fprintf(fid, 'The number of entered objects was %d \n', size(shape,1));fprintf(fid,'%s \t\t %s \t\t %s \t\t %s\n','No.','ID','Color','Area');for i=1:size(shape,1) fprintf(fid, '%d %s %s %f',shape{i,:}); fprintf('\n');endfclose(fid);end
This is a sub-function I used to output a table in .txt file. However, the error kept pumping up as
Error using fprintfFunction is not defined for 'cell' inputs.
I wonder what's causing the problem.
Best Answer