Info
此问题已关闭。 请重新打开它进行编辑或回答。
I need to create a 1x6 string combining strings?
1 次查看(过去 30 天)
显示 更早的评论
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!