Understanding the Interactive Matrix Language

Character Literals

You input a character matrix literal by entering character strings. If you do not use quotes, all characters are converted to uppercase. You must use either single or double quotes to preserve case or when blanks or special characters are present in the string. For character matrix literals, the length of the elements is determined from the longest element. Shorter strings are padded on the right with blanks. For example, the following assignment of the literal results in a being defined as a 1 x 2 character matrix with string length 4 (the length of the longer string):

  
    a={abc defg};
 
Here is the resulting matrix:
  
                                 A 
                                 ABC  DEFG
 
The following assignment preserves the case of the elements:
  
    a={'abc' 'DEFG'};
 
Here is the resulting matrix:
  
                                 A 
                                 abc  DEFG
 
Note that the string length is still 4.

Previous Page | Next Page | Top of Page