SlideShare a Scribd company logo
1
Chapter 1
STARTING WITH MATLAB
2
Command Window,
enters variables, runs
programs.
Logs commands
entered in the
command
window
Shows the
files in the
current
directory
1.1 Starting Matlab, Matlab Windows
Figure 1-1: The default view of MATLAB Desktop
3
1.1 Starting Matlab, Matlab Windows
Figure 1-2: Controlling MATLAB Windows
4
|
1.2 Working In The Command Window
Figure 1-3: The Command Window
Notes for working in the Command Window:
• To type the cursor must be placed next to ( >> ).
• The command is executed by pressing the ENTER key.
• Everything Executed previously is remain unchanged.
• Several Commands can be typed in the same line by typing COMMA
( , ) between and when ENTER key is pressed the commands run
from left to right.
• A previously typed command can be recalled with up-arrow key and
down-arrow key.
• If a command is too long to fit one line, it can be continued by
typing ( … ) called an ellipsis after pressing ENTER key and then
typing it in the new line.
5
1.3 Defining Scalar Variables
Predefined Keywords and Variables
There are 20 words, called keywords, that are reserved by MATLAB for various
purposes and cannot be used as variable names. These words are:
break case catch classdef continue else elseif end
for function global if otherwise parfor
persistent return spmd switch try while.
The keywords can be displayed by typing the command iskeyword.
>> break=71;
??? break=71;
|
Error: The expression to the left of the equals sign is not a valid target
for an assignment.
• The symbols for arithmetic operations with scalars are summarized below:
The left division is mostly used for operations with arrays. For
scalars, the left division is the inverse of the right division.
6
1.4 Arithmetic Operations With Scalars
Table 1-1
7
1.4 Arithmetic Operations With Scalars
8
1.5 Some Useful Commands
 clc: clears the command window.
 who: lists the names of all created variables.
 whos: lists the names of all created variables and some information about each
variable.
 clear: removes all variables and functions from memory
 help: shows help topics.
9
1.6 Display Formats
10
CHAPTER
ONE
1.6 Elementary Math Built-in Functions
11
1.6 Elementary Math Built-in Functions
The inverse trigonometric functions are asin(x), acos(x), atan(x), acot(x) for the angle
in radians; and asind(x), acosd(x), atand(x), acotd(x) for the angle in degrees. The
hyperbolic trigonometric functions are sinh(x), cosh(x), tanh(x), and coth(x) and their
inverses are asinh(x), acosh(x), atanh(x), and acoth(x) .
12
CHAPTER
ONE
1.6 ELEMENTARY MATH BUILT-IN FUNCTIONS
Round towards Plus infinity
13
CHAPTER
ONE
1.6 Elementary Math Built-in Functions
14
Example
A trigonometric identity is given by
verify the identity is correct by calculating each side of equation,
let,
use
Command window

More Related Content

PPTX
Matlab ch1 (2)
PPTX
3_MATLAB Basics Introduction for Engineers .pptx
PPT
Introduction to Matlab
PDF
MATLAB Linear Algebra 1st Edition Cesar Lopez
PPT
Chapter 01.ppt
PPT
Chapter 01.ppt
PDF
A complete introduction on matlab and matlab's projects
PPTX
MATLAB : Introduction , Features , Display Windows, Syntax, Operators, Graph...
Matlab ch1 (2)
3_MATLAB Basics Introduction for Engineers .pptx
Introduction to Matlab
MATLAB Linear Algebra 1st Edition Cesar Lopez
Chapter 01.ppt
Chapter 01.ppt
A complete introduction on matlab and matlab's projects
MATLAB : Introduction , Features , Display Windows, Syntax, Operators, Graph...

Similar to Chapter 1 Starting With MATLAB matlab.pptx (20)

PDF
Matlabch01
PDF
Chapter 1.pdf
PDF
Matlab Introduction and Basics Guide.pdf
PPT
matlabchapter1.ppt
PPT
Introduction to matlab
DOCX
Introduction to matlab
PPTX
Introduction to scientific computing with matlab.pptx
PPT
Palm m3 chapter1b
PDF
MATLAB Basics-Part1
PPT
Chapter 1.ppt
PDF
Introduction to matlab
PDF
An Introduction to MATLAB with Worked Examples
PPT
Introduction to Matlab - Basic Functions
PPTX
Chap#0_Introducation_to_nsnsnnMATLAB.pptx
PPTX
Chapter 1 _ Introduction to Matlab.pptx
PPT
Matlab Basic Tutorial
PDF
Matlab ii(1)
PPTX
Introduction to programming in MATLAB
PDF
lessohhhh7g7g7g5d5d5x6cugiguguv7vu8g8g8g8
Matlabch01
Chapter 1.pdf
Matlab Introduction and Basics Guide.pdf
matlabchapter1.ppt
Introduction to matlab
Introduction to matlab
Introduction to scientific computing with matlab.pptx
Palm m3 chapter1b
MATLAB Basics-Part1
Chapter 1.ppt
Introduction to matlab
An Introduction to MATLAB with Worked Examples
Introduction to Matlab - Basic Functions
Chap#0_Introducation_to_nsnsnnMATLAB.pptx
Chapter 1 _ Introduction to Matlab.pptx
Matlab Basic Tutorial
Matlab ii(1)
Introduction to programming in MATLAB
lessohhhh7g7g7g5d5d5x6cugiguguv7vu8g8g8g8
Ad

More from danartalabani (13)

PPTX
Chapter 4 Two Dimensional Plots aaa---.pptx
PPTX
Chapter 3 - Programming in Matlab. aaaapptx
PPTX
Chapter 2 Arrays part B aaaaaaaaaaa.pptx
PPTX
reinforcing stee reinforcing stee zhi99.pptx
PPTX
reinforcing steel reinforcing steereinforcing stee.pptx
PPTX
Presentation basic Presentation basic (2).pptx
PPTX
CIVIL2 Civil Civil Civil Civil Civil.pptx
PPTX
Civil Civil Civil Civil Civil Civil.pptx
PPTX
basic civil basic basic basic basic.pptx
PPT
Vectors Vectors Vectors Vectors Vectors1.ppt
PPT
MULTIPLE INTEGRALS MULTIPLE INTEGRALS upload.ppt
PPT
FUNCTIONS LIMITS AND CONTINUITYLIMITS AND CONTINUITY.ppt
PPT
LIMITS AND CONTINUITY LIMITS AND CONTINUITY.ppt
Chapter 4 Two Dimensional Plots aaa---.pptx
Chapter 3 - Programming in Matlab. aaaapptx
Chapter 2 Arrays part B aaaaaaaaaaa.pptx
reinforcing stee reinforcing stee zhi99.pptx
reinforcing steel reinforcing steereinforcing stee.pptx
Presentation basic Presentation basic (2).pptx
CIVIL2 Civil Civil Civil Civil Civil.pptx
Civil Civil Civil Civil Civil Civil.pptx
basic civil basic basic basic basic.pptx
Vectors Vectors Vectors Vectors Vectors1.ppt
MULTIPLE INTEGRALS MULTIPLE INTEGRALS upload.ppt
FUNCTIONS LIMITS AND CONTINUITYLIMITS AND CONTINUITY.ppt
LIMITS AND CONTINUITY LIMITS AND CONTINUITY.ppt
Ad

Recently uploaded (20)

PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
DOCX
573137875-Attendance-Management-System-original
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPT
Mechanical Engineering MATERIALS Selection
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PPTX
Safety Seminar civil to be ensured for safe working.
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Foundation to blockchain - A guide to Blockchain Tech
Model Code of Practice - Construction Work - 21102022 .pdf
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
bas. eng. economics group 4 presentation 1.pptx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
573137875-Attendance-Management-System-original
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Embodied AI: Ushering in the Next Era of Intelligent Systems
Mechanical Engineering MATERIALS Selection
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
CH1 Production IntroductoryConcepts.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Safety Seminar civil to be ensured for safe working.
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx

Chapter 1 Starting With MATLAB matlab.pptx

  • 2. 2 Command Window, enters variables, runs programs. Logs commands entered in the command window Shows the files in the current directory 1.1 Starting Matlab, Matlab Windows Figure 1-1: The default view of MATLAB Desktop
  • 3. 3 1.1 Starting Matlab, Matlab Windows Figure 1-2: Controlling MATLAB Windows
  • 4. 4 | 1.2 Working In The Command Window Figure 1-3: The Command Window Notes for working in the Command Window: • To type the cursor must be placed next to ( >> ). • The command is executed by pressing the ENTER key. • Everything Executed previously is remain unchanged. • Several Commands can be typed in the same line by typing COMMA ( , ) between and when ENTER key is pressed the commands run from left to right. • A previously typed command can be recalled with up-arrow key and down-arrow key. • If a command is too long to fit one line, it can be continued by typing ( … ) called an ellipsis after pressing ENTER key and then typing it in the new line.
  • 5. 5 1.3 Defining Scalar Variables Predefined Keywords and Variables There are 20 words, called keywords, that are reserved by MATLAB for various purposes and cannot be used as variable names. These words are: break case catch classdef continue else elseif end for function global if otherwise parfor persistent return spmd switch try while. The keywords can be displayed by typing the command iskeyword. >> break=71; ??? break=71; | Error: The expression to the left of the equals sign is not a valid target for an assignment.
  • 6. • The symbols for arithmetic operations with scalars are summarized below: The left division is mostly used for operations with arrays. For scalars, the left division is the inverse of the right division. 6 1.4 Arithmetic Operations With Scalars Table 1-1
  • 8. 8 1.5 Some Useful Commands  clc: clears the command window.  who: lists the names of all created variables.  whos: lists the names of all created variables and some information about each variable.  clear: removes all variables and functions from memory  help: shows help topics.
  • 11. 11 1.6 Elementary Math Built-in Functions The inverse trigonometric functions are asin(x), acos(x), atan(x), acot(x) for the angle in radians; and asind(x), acosd(x), atand(x), acotd(x) for the angle in degrees. The hyperbolic trigonometric functions are sinh(x), cosh(x), tanh(x), and coth(x) and their inverses are asinh(x), acosh(x), atanh(x), and acoth(x) .
  • 12. 12 CHAPTER ONE 1.6 ELEMENTARY MATH BUILT-IN FUNCTIONS Round towards Plus infinity
  • 14. 14 Example A trigonometric identity is given by verify the identity is correct by calculating each side of equation, let, use Command window