Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to control the output format of data in matlab?
How to control the output format of data in matlab?
1. the first step is to open matlab on our computer and create a variable str =12345+0438+0489 in the command line window; , using the format; When displaying str, you can see that the default format is short, short is a short algebraic expression, and four decimal places are displayed, as shown in the following figure:

2. In the second step, we use "long format; Str "code changes the data display format to long format, as shown in the figure below:

3, the third step through the "format short g; Str "code makes the data display format short and compact, and you can set different display formats of data as required, as shown in the following figure:

4. Step 4: Click Preset on the homepage to set the default display format for creating variables and arrays, as shown in the following figure:

5. Step 5: After entering the preset interface, click Variable to see that the default array variable format is short, as shown in the following figure:

6. Step 6: Click the drop-down list to set the default display format of array variables, and click OK to finish the setting, as shown in the following figure: