Programming with MATLAB
MATLAB是一种高级编程语言,专为工程师和科学家而设计,直接表达矩阵和数学数学。您可以使用MATLAB for Metore,从运行简单的交互命令以开发大规模应用程序。
Start Simple—No Programming Experience Required
通过同步地执行命令并立即执行命令快速开始。
>> sqrt(42) ans = 6.4807
您可以使用熟悉的语法直接表达矩阵和数组数学。
>> A = [7 8 2; 3 2 6; 5 9 4] A = 7 8 2 3 2 6 5 9 4
马铃薯草®提供成千上万的内置功能,用于共同数学,科学和工程计算。
>> B = eig(A) B = 14.9016 2.3000 -4.2015
You can choose from a variety of built-in plots to visualize your data. Specialized data types, including numeric, string, datetime, categorical, structures, and tables are available to represent your data. You can perform common tasks using functions that are specifically designed for each data type.
>> Stars = Readtable('startypes.xlsx',texttype ='string');>> Stars.Class =分类(星形)星星=课程临时颜色分数_____ _____ ______________________ o 30000“蓝色”3e-05 b 10000“蓝色白色”0.0013 a 7500“白色”0.03G 5200“黄色”0.076 K 3700“浅橙色”0.121米2400“橙红色”0.7645
使用MATLAB,您可以比传统语言更快地开发算法,例如C,C ++或FORTRAN,而无需声明变量,分配内存或编译代码。
学到更多
- Matlab入门(10:00)
- Matlab Onramp.(免费两小时的在线课程)
Combine Commands into a Script
You can combine commands to create scripts that enable you to automate your work. Then add high-level programming constructs such as conditional statements and loops. You can run your script as an entire program or divide it into sections that can be run individually. With the Live Editor, you can create a script that is an executable notebook with output and visualizations next to the code that produced them. Use formatted text, headings, equations, images, and hyperlinks to document your work then share it with others.
编写可重复使用的功能
您可以使用功能将复杂程序分解为更小,可重复使用的部分。您可以在脚本中自动重新签证代码可重用功能。函数可以具有可选的名为参数,使其更易于使用。函数参数验证消除了编写复杂输入错误检查代码的需要。您可以使用启用功能的语言功能来管理和恢复错误。
作者定制课程
使用面向对象的编程,您可以定义对象将数据(属性)与该数据(方法)的功能组合起作用。您可以使用对象来模拟现实世界中设备和系统的行为,并将代码组织成更容易维护和扩展的组件。
麦克拉布班级定义用于构建特定类型对象的一组指令。课程包含有关的信息:
- 存储类的每个对象的属性
- Methods that define the operations that can be performed on each object of the class
- 类属性和方法如何表现以及它们如何从对象外部访问
- 通过继承的类之间的超类和子类关系
开发大规模应用
您可以使用Matlab开发和维护大规模应用程序,使用项目,源控制集成,单元测试,连续集成和部署以及工具箱包装。要了解更多信息,请参阅Software Development Tools。