没有合适的资源?快使用搜索试试~ 我知道了~
Matlab简介内容课件.pptx
资源推荐
资源详情
资源评论
INTRODUCTION TO
MATLAB
It is developed by The Mathworks, Inc. (http://www.mathworks.com)
It is an interactive, integrated, environment
• for numerical/symbolic, scientific computations and other apps.
• shorter program development and debugging time than traditional
programming languages such as FORTRAN and C.
• slow (compared with FORTRAN or C) because it is interpreted.
• automatic memory management; no need to declare arrays.
• intuitive, easy to use.
• compact notations.
What is MATrix LABoratory ?
Introduction to MATLAB
2
Latest version is MATLAB 2012b
For Windows: double click MATLAB icon
For Linux Cluster: katana% matlab
Either case spawns a MATLAB window with >> prompt.
>> % from % to end of line used for code documentation
>> version % this will tell you the running MATLAB version
ans =
7.12.0.635 (R2011a)
>> help % lists available packages/toolboxes on system.
>> help elfun % lists functions in elementary functions package
>> help sin % instructions on the sine function
>> lookfor sine % if you don’t know the function name …
>> doc sin % for full details o ffunction
>> quit % to quit MATLAB
Getting Started With MATLAB
Introduction to MATLAB
3
Variable, function, file names
• is case sensitive, e.g., NAME and Name are 2 distinct names.
• variable begins with a letter, e.g., A2z or a2z
• can be a mix of letters, digits, and underscores (e.g., vector_A)
• reserved characters: % = + – ~ ; : ! ' [ ] ( ) , @ # $ & ^
• up to 63 characters
• A function performs a pre-defined task based on input to yield
certain outcome.
File name
• MATLAB command files should be named with a suffix of ".m", e.g.,
myfile.m. An m-file typically contains a sequence of MATLAB
commands that will be executed in order
• A file may contain a collection of commands, functions
Note: To run, enter m-file, without .m, e.g.,
>> myfile
Rules on Variables and File Names
Introduction to MATLAB
4
• Some characters are reserved by MATLAB for various purposes. Some
as arithmetic or matrix operators: =, +, - , *, / , \ and others are used
to perform a multitude of operations. Reserved characters cannot be
used in variable or function names.
• >> % anything after % until the end of line is treated as comments
>>
• >> a = 3 % define a to have the value 3
a =
3
• >> a = 3; % “;” suppresses printing
>>
• >> b = 4; c = 5; % “;” enables multiple commands on same line
>>
• >> d = 6, e = 7; % “,” delimits commands but enables printing
d =
6
Reserved Characters % = ; ,
Introduction to MATLAB
5
剩余35页未读,继续阅读
资源评论
珞瑜·
- 粉丝: 11w+
- 资源: 500
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功