How to add strings and add spaces

4 vues (au cours des 30 derniers jours)
Jose Grimaldo
Jose Grimaldo le 4 Fév 2020
Modifié(e) : stozaki le 4 Fév 2020
Screenshot (202).png
Im having trouble adding strings together and adding space in between so V=" I Dislike Eggs". I'm using R2019b program.

Réponses (1)

stozaki
stozaki le 4 Fév 2020
Modifié(e) : stozaki le 4 Fév 2020
There are various ways. The following is an example.
L = "I";
M = "Dislike";
N = "Eggs";
V = sprintf("%s %s %s",L,M,N)
Please see following URL as details.
Or
L = 'I';
M = 'Dislike';
N = 'Eggs';
V = [L,' ',M,' ',N]

Catégories

En savoir plus sur Characters and Strings 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