Chapter 1 - General Introduction
Chapter 1 - General Introduction
CS10-8
Learning Goals
○ an extremely rich set of built-in functions to perform many types of technical calculations
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Essentials of MATLAB® Programming, 3rd Edition Chapman
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Other High-Level Programming Languages
Output
Source
Interpreter
Code
“Helloworld”
Helloworld.m
Two kinds of programs process high-level language to low-
level language
2. Compiler
Source
Compiler Object Code Executor Output
Code
1. Ambiguity
2. Redundancy
3. Literalness
Comments
A comment in a computer program is text that is intended
only for the human reader - It is completely ignored by the
interpreter. In Matlab, the % token starts a comment. The rest
of the line is ignored.
Essentials of MATLAB® Programming, 3rd Edition Chapman
MATLAB
Details Window
Command
displays
Window
properties of file
selected above
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Essentials of MATLAB® Programming, 3rd Edition Chapman
Function Description
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Essentials of MATLAB® Programming, 3rd Edition Chapman
● In its simplest form, MATLAB can be used as a calculator to perform mathematical calculations
● Use the symbols +, -, *, /, and ^ for addition, subtraction, multiplication, division, and
exponentiation respectively
● The value in ans can be used in later calculations. But be careful! Every time a new expression
without an equal sign is evaluated, the value saved in ans will be overwritten.
© 2018 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.