Effacer les filtres
Effacer les filtres

matlab single quote problem

1 vue (au cours des 30 derniers jours)
Maria
Maria le 28 Mai 2020
Commenté : Maria le 28 Mai 2020
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

Réponse acceptée

Brent Kostich
Brent Kostich le 28 Mai 2020
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 commentaire
Maria
Maria le 28 Mai 2020
works for me . Thanks !!!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Numeric Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by