Error using fprintf Function is not defined for 'cell' inputs
조회 수: 10 (최근 30일)
이전 댓글 표시
hello everyone.
im trying to save a data into .csv file but i get this error every time i press the save button.
"Error using fprintf
Function is not defined for 'cell' inputs"
CODE:
T = table(app.NEW3,app.NEW1,app.AGE1,app.Gender,app.NEW2,app.GDTT1,app.GDTT2,app.GDTT3,app.GDTT4,app.GDTT5,app.GDTT6,app.AVERAGE);
fid = fopen('Results.csv','a');
fmt = varfun(@(x) class(x),T,'OutputFormat','cell');
fmt(strcmp(fmt,'double'))={'%g'};
fmt(strcmp(fmt,'cell'))={'%s'};
fmt=[strjoin(fmt,',') '\n'];
for r=1:size(T,1)
x=table2cell(T(r,:));
fprintf(fid,fmt,x{:});
end
fclose(fid);
댓글 수: 4
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!