How to add strings and add spaces

2 ビュー (過去 30 日間)
Jose Grimaldo
Jose Grimaldo 2020 年 2 月 4 日
編集済み: stozaki 2020 年 2 月 4 日
Screenshot (202).png
Im having trouble adding strings together and adding space in between so V=" I Dislike Eggs". I'm using R2019b program.

回答 (1 件)

stozaki
stozaki 2020 年 2 月 4 日
編集済み: stozaki 2020 年 2 月 4 日
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]

カテゴリ

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