using sprintf instead of fprintf

9 ビュー (過去 30 日間)
Umut Oskay
Umut Oskay 2020 年 5 月 22 日
回答済み: Walter Roberson 2020 年 5 月 22 日
ı want to use sprintf because of the good properties of the sprintf.It doesnt print to command window. Somebody said use fprintf in a question.But i want to use sprintf and i want to print it in the command window without ans= .... . Can you help me about what i should do thanks.

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 5 月 22 日
You want to use sprintf() because it does not print to the command window, but then you want to print the result to the command window?? Seems like a contradiction, unless you are formatting the text in advance getting it ready for display.
To display a character vector to the command window without ans= you can disp() it, or you can fprintf('%s\n', TheVector)

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT-Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by