Enter a name at the matlab prompt, and then in what order will matlab look up the name in the interpreter?
Example 2 Enter and execute the following statement in the command window and observe the results. Mathematical Modeling Chapter 1 Introduction to MATLAB-19- Input and Implementation: A = [[eye (2); One (2)], one (4, 1), zero (4, 1)] The command window displays: a =101111/kloc-0. 000Input and execute command window shows: ans = 0 4.3 Characters and strings MATLAB uses double bytes (decimal integer ranging from 0 to 65535) to encode characters according to Unicode coding standard. Inside the machine, each character is represented by its corresponding code. For example, the code of space is 32 (decimal integer, the same below), and the code of 0 is 48. The code of A is 65, the code of A is 97, the code of simplified Chinese character "Hui" is 36745, and the code of traditional Chinese character "Hui" is 36637. We can use the conversion function uint 16 or double to check the Unicode code of the string. You can use the conversion function char to display the characters corresponding to Unicode encoding (whether the characters can be displayed depends on whether the relevant character set is installed in the operating system of the machine). In general, we don't need to know the encoding of characters when using strings. The string of MATLAB is a char array composed of characters (chars). The string must be enclosed in a pair of single quotes. Inside the machine, a string is an array of Unicode codes corresponding to characters. Example 3 Enter and execute the following statement in the command window and observe the results. Enter and execute: s1=' hello'; Whos('s') command window displays: name size bytes classes11x 510 chararray, enter and execute: uint 16(s 1). % View Unicode encoding command window display: ans = 721010811/carriage return execution: char(ans)% display Unicode encoding corresponding character command window display: ans = Hello carriage return execution. s2= ','; S3= "Mr. Zhang!" ; The command window shows: S= Hello, Mr. Zhang! However, if you enter and execute: t=[s 1, S2; S3], the command window displays an error message: Cat "Parameter sizes are inconsistent." That is, the composite dimensions of matrices are incompatible. This is because the first line [s 1, s2] has 6 characters, that is, 12 bytes, while the second line s3 has 9 characters. That is, 18 bytes, while the character matrix requires the same number of characters in each row. If you add three spaces to s2, you can solve this small problem: enter and execute: s1=' hello'; s2= ','; S3= "Mr. Zhang!" ; The command window shows: S= Hello, Mr. Zhang!