Character Array initialization and creation
조회 수: 9 (최근 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!