% Write output to text file
fn = sprintf('%s_%s_.txt',filtered.SD,out.mys);
fid = fopen('.txt','wt');
fprintf('%.0f\n',n,x);
fclose(fid);
Error using sprintf
Function is not defined for 'cell' inputs.
Error in tSes (line 39)
fn = sprintf('$s_%s_.txt',filtered.SD,out.mys);
>>
I am getting the above error message using sprintf. What is wrong with the code? Any help is appreciated.

댓글 수: 1

KSSV
KSSV 2020년 8월 14일
It looks filtered.SD is a cell....what is it? What you expect?

댓글을 달려면 로그인하십시오.

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2020년 8월 14일

0 개 추천

>> a={'abc'}
a =
1×1 cell array
{'abc'}
>> sprintf('%s',a)
Error using sprintf
Function is not defined for 'cell' inputs.
>> sprintf('%s',a{1})
ans =
'abc'

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Cell Arrays에 대해 자세히 알아보기

태그

질문:

2020년 8월 14일

댓글:

2020년 8월 14일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by