필터 지우기
필터 지우기

Why the first cell is printed in one row and second in two? (fprintf)

조회 수: 1 (최근 30일)
Akbar
Akbar 2018년 6월 6일
편집: Stephen23 2018년 6월 6일
Why the first cell is printed in one row and second in two? I want the second cell to be printed in one row, same as first.
fprintf('%s,...\n',maCell{:})
Output:
Y_X_mAb,...
g_Gravitational_acceleration
,...
Desired output:
Y_X_mAb,...
g_Gravitational_acceleration,...

채택된 답변

Stephen23
Stephen23 2018년 6월 6일
편집: Stephen23 2018년 6월 6일
The problem is that the data itself contains newline characters (10=\n):
>> +maCell{2}(end)
ans = 10
Remove those characters and you will not have this problem:
maCell = deblank(maCell);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by