Character Array initialization and creation
3 次查看(过去 30 天)
显示 更早的评论
how can i create a character array and initialize its elements with user defined or predifined values
0 个评论
回答(1 个)
James Tursa
2015-7-10
The straightforward answer is simply to assign a string to a variable name. E.g.,
mystring = 'This is a string'; % Initialize mystring
If you want to initialize with a user defined string, then e.g.,
mystring = input('Input the initialization string: ','s');
If you want a more detailed answer, please give more details about what you really want.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!