1. Step 1: Install matlab software on the computer, as shown in the figure below, and enter the following steps.
2. Step 2: After completing the above steps, double-click the matlab icon to open its home page, as shown below, and enter the following steps.
3. Step 3: After completing the above steps, move the mouse to the "New" option, then click once, select and click the "Function" option in the pop-up menu, as shown below, and enter the following steps.
4. Step 4: After completing the above steps, this is the M file editing page, as shown below, and enter the following steps.
5. Step 5: After completing the above steps, write the function calculation relationship between input variables and output variables, as shown in the figure below, and enter the following steps.
6. Step 6: After completing the above steps, click the "Save" option in the upper left corner to save, as shown below, and enter the following steps.
7. Step 7: After completing the above steps, if you want to call the M file, you only need to save the file to be called in the main interface folder of the Command Window in turn, then wrap the line in the Command Window, enter the file name and enter the details of all input variables.
At the same time, fill in the values and press Enter on the keyboard to instruct to call and run the M file, as shown below. In this way, the problem is solved.