Matlab M 文件 - 运行
在上一章中,我们了解了如何创建和保存 m 文件。现在在本章中,我们将编写一个简单的代码并运行它。
以下是将在firstmfile.m中运行的代码
a = 5; b = 7; c = a + b d = c + sin(b) e = 5 * d f = exp(-d)
这是 MATLAB 编辑器中的样子 -

单击上面突出显示的“运行”按钮,在命令窗口中查看结果,如下所示

在上一章中,我们了解了如何创建和保存 m 文件。现在在本章中,我们将编写一个简单的代码并运行它。
以下是将在firstmfile.m中运行的代码
a = 5; b = 7; c = a + b d = c + sin(b) e = 5 * d f = exp(-d)
这是 MATLAB 编辑器中的样子 -
单击上面突出显示的“运行”按钮,在命令窗口中查看结果,如下所示