フィルターのクリア

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 Center および File ExchangeGet 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