Character Array initialization and creation

2 Ansichten (letzte 30 Tage)
Abbas Electricwala
Abbas Electricwala am 10 Jul. 2015
Beantwortet: James Tursa am 10 Jul. 2015
how can i create a character array and initialize its elements with user defined or predifined values

Antworten (1)

James Tursa
James Tursa am 10 Jul. 2015
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.

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by