SoftwareApplicationInTermsOFMatlabSimulation

MechTech9 11 views 20 slides May 27, 2024
Slide 1
Slide 1 of 20
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20

About This Presentation

SoftwareApplicationInTermsOFMatlabSimulation


Slide Content

UNIT - I INTRODUCTION TO MATLAB

MATLAB It comes from the two words, MAT- stands for MATRIX LAB- stands for LABORATORY Matlab is a matrix laboratory.It deals with matrices.Hence,basic building block in matlab is matrix. The basic data type ,matrix is defined as an array ,the vectors,scalars etc. are all automatically handled as matrices.The scalars are treated as matrix of a single row and single coloum.A single row matrix & single coloumn matrix are treated as row vectors & column vectors respectively.

Matlab software looks like ICON -- > < -- Starting Window

STANDARD MATLAB WINDOWS There are following windows in matlab , Command Window Command History Window Workspace Window Current Directory Window Figure Window Edit Window

1) Command Window

Command Window When matlab invoked the main window called command window is activated.It displays the command prompt “ >> “ & a cursor where commands are entered. And are executed instantaneously on pressing the Enter key of the keyboard.

2) Command History Window

Command History Window This window consist of a list of all the commands that are entered at the command window. It consist of commands in previous sessions also. These commands remain in the list until they are deleted. Any command may be executed by selecting and double clicking it with the mouse. A program file may be created by selecting a set of commands & right clicking the mouse. On right clicking pop up menu is displayed.

3) Workspace Window

Work Space Window It is the collection of all the variables that have been generated in the current matlab session & shows their data type & size. All the commands executed from command window and all the script files executed from command window share comman workspace , so they can share all the variables.

4) Current Directory Window

Current Directory Window In this window all the files & folders present in the current directory are shown. To run any file it must either be in current directory or on the search path

5) Figure Window

Figure Window Fig. window is a separate window with default white background & is used to display matlab graphics. The result of all graphics commands executed are display in fig. window.

6) Edit Window

Edit Window It is used to creat a new progarm file or to modify existing files. In this window programs can be written ,edited & saved. The programs written using matlab editor are automatically assigned an extension (.m) by the editor & are known as M – files. A new m-file can be created by selecting, file / new/ m.file . An existing m-file can be open by selecting file/open. In the edit window different features of matlab languages are shown in different colours .

Comment = Green Variable , numbers = Black Characters strings = Red / Purple Matlab keyword = Blue

Constants & Variables CONSTANTS :--- Constant refer to fixed value which do not change during the execution of a program. Constants can be of two types, Numeric constant Integer constant Real constant Complex constant or Complex number Character constant Single character constant String constant Escape sequence constant

Numeric Constant Integer Constant :– I t consist of a set of digits 0 to 9 with an optinal “-” & “+” sign. Example :- 456 -120 +34 23576 Space, commas, non digit characters are not allowed between digits in integer constants. Example :- 25/670 1,500 Rs.200 Real Constant :- Scientific quantities that vary continuously such as speed , temperature, etc .can not be represented using integer constant such a quantities are represented by using number that contain fractional part such number called Real Constant. Example : - 0.0065 -45.67 102.345 Real constant can also be expressed in exponential notation ; 435.25 can be written as ; 4.3525 e + 2 or 43525 e - 2 Where , e ± 2 means multiplication by 10 ^ ( ± 2)

3) Complex Constant
Tags