matlab single quote problem
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 

0 Commenti
Risposta accettata
Brent Kostich
il 28 Mag 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))];
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Characters and Strings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!