Character Array initialization and creation

4 ビュー (過去 30 日間)
Abbas Electricwala
Abbas Electricwala 2015 年 7 月 10 日
回答済み: James Tursa 2015 年 7 月 10 日
how can i create a character array and initialize its elements with user defined or predifined values

回答 (1 件)

James Tursa
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.

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by