About array and string
1 次查看(过去 30 天)
显示 更早的评论
How to input some strings to an array for example if i type aa then bb then cc so i will have variable A=( aa bb cc)
Please don't delete this i really need the answer....
0 个评论
回答(2 个)
Steven Lord
2018-9-24
Since you've indicated you're using release R2012a, the string data type introduced in release R2016b isn't an option for you. [If upgrading is an option, I would recommend doing so as that would let you use string.]
So you're going to need to make either a char array or a cell array containing char vectors. Search your locally installed documentation for the three word phrase "Creating Character Arrays" and read the first two hits for information on how to use each of these two techniques.
0 个评论
Joel Meyer Espinoza
2018-9-24
not sure if this is what you asked for use strcat https://de.mathworks.com/help/matlab/ref/strcat.html
for example a='Hello'; b=' World'; s = strcat(a,b)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!