fopen function - file function:
The fopen opens the file for reading. The fscanf then reads each line one double and one character, and put each pair in individual columns in the matrix. The dimensions identify that the matrix has two rows, by though many columns are essential (equivalent to the number of lines in the file). As matrices store the values which are all of similar type, the characters are stored as their ASCII equivalents in the character encoding (example, 'a' is 97). This matrix has been once created; it may be more helpful to separate the rows into vector variables and to convert the second back to characters, that can be completed as shown below:
>> nums = mat(1,:);
>> charcodes = char(mat(2,:))
Obviously, the results from fopen and fclose must be checked but were absent here for the simplicity.