Hi, I am writing with matlab a tlc file wich I'm going to use with other program. I need to be able to read this line in the output file
puts "\nAnalysis started : [clock format $time_start -format %H:%M:%S]"
But when i write it with fprintf function /n becomes a breakline and the %H:%M:%S disapears.
How can i do it?

 採用された回答

dpb
dpb 2017 年 11 月 14 日
編集済み: dpb 2017 年 11 月 14 日

1 投票

Have to double-down on the control characters to prevent them being interpreted and to print instead...
>> str='puts "\\nAnalysis started : [clock format $time_start -format %%H:%%M:%%S]"';
>> fprintf(str)
puts "\nAnalysis started : [clock format $time_start -format %H:%M:%S]"
It's buried in the documentation for fprintf formatting strings...

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

製品

質問済み:

2017 年 11 月 14 日

編集済み:

dpb
2017 年 11 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by