matlab single quote problem

1 回表示 (過去 30 日間)
Maria
Maria 2020 年 5 月 28 日
コメント済み: Maria 2020 年 5 月 28 日
how should I output this sentence in single quote instead of double quote? Because change the double quote to single quote directly is not work

採用された回答

Brent Kostich
Brent Kostich 2020 年 5 月 28 日
You need to use brackets when creating a multi-part sentence like that, which is equal to horzcat. Also, you need to use character segments, not strings.
pi = ['The approximation on ', num2str(n), ' terms is ', num2str(round(pi*4, 4))];
  1 件のコメント
Maria
Maria 2020 年 5 月 28 日
works for me . Thanks !!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by