Info
この質問は閉じられています。 編集または回答するには再度開いてください。
I need to create a 1x6 string combining strings?
1 回表示 (過去 30 日間)
古いコメントを表示
![Screenshot (204).png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/269737/Screenshot%20(204).png)
![Screenshot (203).png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/269738/Screenshot%20(203).png)
I'm having trouble creating a 1x6 string setting X="I Love Pizza Not Vegatibles" using the variables L,I,J and also adding spaces. I'm assuming i have to combine strings to create a 1x6 string. There is also a space at the beginning .
回答 (2 件)
KSSV
2020 年 2 月 4 日
Method 1:
% Add space with the strings itself
s1 = " I " ;
s2 = " LOVE " ;
s3 = " MATLAB " ;
iwant = [s1,s2,s3] ;
Method 2
% Add space at the time of joining
s1 = "I" ;
s2 = "LOVE" ;
s3 = "MATLAB" ;
iwant = [s1,' ',s2,' ',s3] ;
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!