You are on page 1of 8

MATLAB PRIMER

Chapter 1-The Basics


Command View or change the Move or Undock
Toolbar and
Help Prompt current Directory Command Window
Short cuts

Command
Window

Current
Directory

Command
History

August 8, 2019 Basic Simulation Lab with MATLAB


Desktop Layout

See Desktop Pull-Down Menu

Default options?
Can be changed

August 8, 2019 Basic Simulation Lab with MATLAB


Current Directory
• >> Pathtool
– Setpath window
– Add Folder
– Make New folder
– Save, Close
– CD at Com.Pmpt

August 8, 2019 Basic Simulation Lab with MATLAB


August 8, 2019 Basic Simulation Lab with MATLAB
A Simple Program
• % This program multiplies two vectors P and Q
• % P is a column vector of 3 elements
• % Q is a row vector of 3 elements
• % Result is assigned to R which will be a 3 x 3
matrix
• P = [ 4; 5; 6;]
• Q = [1 2 3]
• R = P*Q

August 8, 2019 Basic Simulation Lab with MATLAB


File Creation
• File, New, M-File

• Shortcut, Copy, Paste

• Select from CHW, Right Click

• Execute from CW using CP

August 8, 2019 Basic Simulation Lab with MATLAB


Help
• Help at CP
• F1
• ?
• Search
• Index
• Demos
• www.mathworks.com/
matlabcentral

August 8, 2019 Basic Simulation Lab with MATLAB

You might also like