MATLAB的简单使用
MATLAB的简单使用.mp300:0002:06未加入话题
一、打开MATLAB软件;
1. Open the MATLAB software;
二、在命令行窗口内,我们可以进行简单的数学运算,如四则运算、次方运算等,还可以定义矩阵;(定义矩阵时,格式为:x=[ ],同一行的元素之间用空格隔开,换行用分号“;”)
2. In the command line window, we can perform simple mathematical operations, such as four arithmetic operations, power operations, etc., and also define a matrix; (when defining a matrix, the format is: x=[ ], use between elements in the same row Separate by spaces, use semicolon \”;\” for line breaks)
三、在对矩阵进行计算时,需要用到“.*”以及“./”等,如A和B都是三阶方阵,“.*”代表把A和B两个矩阵对应位置元素相乘在分别放入该位置生成一个新的矩阵;(“.*”和“./”类似)
3. When calculating the matrix, you need to use \”.*\” and \”./\”, etc., for example, A and B are both third-order square matrices, and \”.*\” represents the corresponding position elements of the two matrices A and B. Multiply and put them into the position to generate a new matrix; (\”.*\” and \”./\” are similar)
四、同时,我们也可以使用sin、cos以及一些其他的在MATLAB内部设定好的函数进行计算;(在调用诸如sin、cos等函数时要使用括号)
4. At the same time, we can also use sin, cos and some other functions set in MATLAB to perform calculations; (brackets should be used when calling functions such as sin, cos, etc.)
五、右边的“工作区”里储存着我们定义过的变量,有一个变量是“ans”,代表结果,每次计算,ans的值都会被重新赋予;想要清除某一变量,输入“clear”和想清除的变量,如果在clear后面不加变量,则会清除所有变量;“clc”清除命令行窗口里的命令;
5. The variables we have defined are stored in the \”work area\” on the right. One variable is \”ans\”, which represents the result. Each time the calculation is performed, the value of ans will be re-assigned; if you want to clear a variable, enter \”clear\” \”And the variable you want to clear. If you do not add a variable after clear, all variables will be cleared; \”clc\” clears the command in the command line window;
六、右下角的“命令历史记录”保留着我们发出的每一命令;
6. The \”Command History\” in the lower right corner retains every command we issued;
七、在使用过程中,我们最常在“脚本编辑器”里进行操作,和各大编程语言类似,MATLAB在脚本编辑器里使用自己的语言进行操作,结果在命令行窗口里显示。(点击“运行”)
7. During use, we most often operate in the \”Script Editor\”, similar to major programming languages, MATLAB uses its own language to operate in the script editor, and the results are displayed in the command line window. (Click \”Run\”)
本文由learningyard新学苑原创,如有侵权请联系沟通~
图片为电脑截图