[PDF] INTRODUCTION TO MATLAB FOR ENGINEERING STUDENTS





Previous PDF Next PDF



Least Squares

17 сент. 2013 г. The MAtlAB function polyfit computes least squares polynomial fits by setting up the design matrix and using backslash to find the ...



Magic Squares Magic Squares

2 окт. 2011 г. Write a MAtlAB function ismagic(A) that checks if A is a magic square. 10.2 Magic sum. Show that. 1 n n2. ∑ k=1 k = n3 + n. 2 . 10.3 durerperm ...



Some important Built-in function in MATLAB 1. Square root b=sqrt(x

14 мар. 2020 г. Some important Built-in function in MATLAB. 1. Square root b=sqrt(x) b=sqrt(4). 2. 2. Remainder of dividing x/y a=rem(xy) a=rem(10



Objective 1 Triangular Wave 2 Square Wave 3 Discrete Time

2 Square Wave. MATLAB has a built-in function square to generate a periodic square waveform. Following example will help you draw such a waveform. 2.1 



- 1 - Some MATLAB Built-in Functions Function Description sqrt(x

Some MATLAB Built-in Functions. Function. Description sqrt(x). Square root of x nthroot(xn) nth root of x abs(x). Absolute value of x exp(x). Exponential (ex).



Eigenvalues and Singular Values

16 сент. 2013 г. The Matlab function condeig computes eigenvalue condition numbers. ... The qr function in Matlab factors any matrix real or complex



Quadrature

area—plot the function on graph paper and count the number of little squares that The function functions in Matlab itself usually expect the first argument to.



Iteration Iteration

2 окт. 2011 г. Matlab responds with x = 3. Next enter this statement x = sqrt(1 + x). The abbreviation sqrt is the Matlab name for the square root function.



Total Least Squares Approach to Modeling: A Matlab Toolbox Total Least Squares Approach to Modeling: A Matlab Toolbox

In this section we show some applications of the TLS method in static and dynamical modeling by using the created Matlab functions [14]. 3.1 Linear regression 



Implementing the 2D square lattice Boltzmann method in Matlab

23 февр. 2023 г. In contrast to LGA. LBM deals with distribution function values instead of single particles. The exact denomination for the following described ...



General Linear Least-Squares and Nonlinear Regression

Applied Numerical Methods with MATLAB for Engineers Chapter 15 & Teaching The least-squares ... function that returns the sum of the squares of the.



Objective 1 Triangular Wave 2 Square Wave 3 Discrete Time

MATLAB has a built-in function sawtooth to generate a periodic triangular waveform. Following example will help you draw such a waveform. 1.1 Example. Generate 



Magic Squares

2011?10?2? An n-by-n magic square is an array containing the integers from 1 to n2 ... squares of order n but the MAtlAB function magic(n) generates a ...



Least Squares

2013?9?17? The MAtlAB function polyfit computes least squares polynomial fits by setting up the design matrix and using backslash to find the ...



Some important Built-in function in MATLAB 1. Square root b=sqrt(x

2020?3?14? Some important Built-in function in MATLAB. 1. Square root b=sqrt(x) b=sqrt(4). 2. 2. Remainder of dividing x/y a=rem(xy) a=rem(10



Eigenvalues and Singular Values

2013?9?16? A singular value and pair of singular vectors of a square or ... qr function in Matlab factors any matrix real or complex



Iteration

2011?10?2? The abbreviation sqrt is the Matlab name for the square root function. The quantity on the right. /. 1 + x



DEPARTMENTS OF MATHEMATICS

1999?1?4? MAtlAB has included since at least version 3 a function sqrtm for computing a square root of a matrix. The function works by reducing the ...



INTRODUCTION TO MATLAB FOR ENGINEERING STUDENTS

The function diary is useful if you want to save a complete MATLAB session. of vectors in MATLAB are enclosed by square brackets and are separated by ...



Total Least Squares Approach to Modeling: A Matlab Toolbox

In this section we show some applications of the TLS method in static and dynamical modeling by using the created Matlab functions [14]. 3.1 Linear regression 



MATLAB Basic Functions Reference - MathWorks

Tasks represent a series of MATLAB commands To see the commands that the task runs show the generated code Common tasks available from the Live Editor tab on the desktop toolstrip: • Clean Missing Data • Clean Outlier • Find Change Points • Find Local Extrema • Remove Trends • Smooth Data mathworks com/help/matlab



Chapter 10 Magic Squares - MathWorks

Ann-by-nmagic square is an array containing the integers from 1 ton2arranged so that each of the rows each of the columns and the two principaldiagonals have the same sum For eachn >2 there are many di?erent magicsquares of ordern but theMatlabfunctionmagic(n)generates a particular one Matlabcan generate Lo Shu with = magic(3) which produces



MATLAB Function Example Handout - University of Wyoming

ical function libraries The Matlab Optimization and Curve Fitting Toolboxes include functions for one-norm and in?nity-norm problems We will limit ourselves to least squares in this book 5 3 censusgui The NCM program censusgui involves several di?erent linear models The data



Chapter 1 Iteration - MathWorks

In Matlab and most other programming languages the equals sign is the assignment operator It says compute the value on the right and store it in the variable on the left So the statement x = sqrt(1 + x) takes the current value of x computes sqrt(1 + x) and stores the result back in x



Functions and Scripts - Electrical Engineering and Computer

Many functions are programmed inside MATLAB as built-in functions and can be used in mathematical expressions simply by typing their name with an argument; examples are sin(x) cos(x) sqrt(x) and exp(x) MATLAB has a plethora of built-in functions for mathematical and scientific computations



Chapter 1 Introduction to MATLAB - MathWorks

MATLAB An introduction to MATLAB through a collection of mathematical and com-putational projects is provided by Moler’s free online Experiments with MATLAB [6] A list of over 1500 Matlab-based books by other authors and publishers in several languages is available at [12] Three introductions to Matlab are of par-



MATLAB Getting Started Guide - Massachusetts Institute of

The load function reads binary files containing matrices generated by earlier MATLAB sessions or reads text files containing numeric data The text file should be organized as a rectangular table of numbers separated by blanks with one row per line and an equal number of elements in each row



MATLAB Function Tips - Michigan State University

function [xsqrd xcubd] = square(x) xsqrd = x^2 xcubd = x^3 There are two possible places to position this code If you are using MATLAB 5 0 or later this function code can be placed at the end of the main program in the same file as the main program It could also be placed in its own file which must use the function name or for our example



Matlab Introduction - California State University Long Beach

The batch commands in a file are then executed by typing the name of the file at the Matlab command prompt The advantage to using a ' m' file is that you can make small changes to your code (even in different Matlab sessions) without having to remember and retype the entire set of commands



6057 Introduction to MATLAB Homework 2 - MIT OpenCourseWare

Use magenta square symbols of marker size 10 and line width 4 and no line connecting them You may have to change the x limits to see all 6 symbols (xlim) If the relationship really is exponential it will look linear on a log plot 2 Subplot and axis modes Make a new Square Tight 100 100 200 figure that has a 2x2 grid of axes () subplot 200



MATLAB Commands and Functions - College of Science and

MATLAB Commands – 11 M-Files eval Interpret strings containing Matlab expressions feval Function evaluation function Creates a user-defined function M-file global Define global variables nargin Number of function input arguments nargout Number of function output arguments script Script M-files Timing cputime CPU time in seconds



Searches related to function square matlab filetype:pdf

MATLAB is installed on the engineering instructional facility You can find it in the Start>Programs menu You can also install MATLAB on your own computer This is a somewhat involved process –you need to first register your name at mathworks then wait until they create an account for you there then download MATLAB and activate it

What are the functions of MATLAB?

  • MATLAB Function Example Handout. MatLab is a high performance numeric computing environment, which includes numerical analysis, matrix computation, signal processing, and graphics to provide answers to the most troubling of mathematical problems. This handout provides different examples to show the different aspects of MatLab.

How to generate unit step function in MATLAB?

  • function [x]=unitstep (x) %This is a unit step "function". The vector keeping track of time is the %input. If time is negative then a zero is returned. If time is zero than %0.5 is returned.

How to generate square wave in MATLAB?

  • Square wave is generated using “square” function in Matlab. The command sytax – square (t,dutyCycle) – generates a square wave with period for the given time base. The command behaves similar to “ sin ” command (used for generating sine waves), but in this case it generates a square wave instead of a sine wave.

INTRODUCTION TO MATLAB FOR

ENGINEERING STUDENTS

David Houcque

Northwestern University

(version 1.2, August 2005)

Contents

1

Tutorial lessons 1

1 1.1

Introduction

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2

Basic features

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3

A minimum MATLAB session

. . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3.1 Starting MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3.2 Using MATLAB as a calculator . . . . . . . . . . . . . . . . . . . . . 4

1.3.3 Quitting MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.4

Getting started

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.4.1 Creating MATLAB variables . . . . . . . . . . . . . . . . . . . . . . . 5

1.4.2 Overwriting variable . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.4.3 Error messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.4.4 Making corrections . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.4.5 Controlling the hierarchy of operations or precedence . . . . . . . . . 6

1.4.6 Controlling the appearance of °oating point number . . . . . . . . . . 8

1.4.7 Managing the workspace . . . . . . . . . . . . . . . . . . . . . . . . . 8

1.4.8 Keeping track of your work session . . . . . . . . . . . . . . . . . . . 9

1.4.9 Entering multiple statements per line . . . . . . . . . . . . . . . . . . 9

1.4.10 Miscellaneous commands . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.4.11 Getting help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.5

Exercises

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2

Tutorial lessons 2

12 2.1

Mathematical functions

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.1.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

i 2.2

Basic plotting

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.2.1 overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.2.2 Creating simple plots . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.2.3 Adding titles, axis labels, and annotations . . . . . . . . . . . . . . . 15

2.2.4 Multiple data sets in one plot . . . . . . . . . . . . . . . . . . . . . . 16

2.2.5 Specifying line styles and colors . . . . . . . . . . . . . . . . . . . . . 17

2.3

Exercises

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.4

Introduction

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.5

Matrix generation

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

2.5.1 Entering a vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

2.5.2 Entering a matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.5.3 Matrix indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.5.4 Colon operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2.5.5 Linear spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2.5.6 Colon operator in a matrix . . . . . . . . . . . . . . . . . . . . . . . . 22

2.5.7 Creating a sub-matrix . . . . . . . . . . . . . . . . . . . . . . . . . . 23

2.5.8 Deleting row or column . . . . . . . . . . . . . . . . . . . . . . . . . . 25

2.5.9 Dimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

2.5.10 Continuation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

2.5.11 Transposing a matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

2.5.12 Concatenating matrices . . . . . . . . . . . . . . . . . . . . . . . . . . 26

2.5.13 Matrix generators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

2.5.14 Special matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

2.6

Exercises

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3

Array operations and Linear equations

30
3.1

Array operations

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

3.1.1 Matrix arithmetic operations . . . . . . . . . . . . . . . . . . . . . . . 30

3.1.2 Array arithmetic operations . . . . . . . . . . . . . . . . . . . . . . . 30

3.2 Solving linear equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

3.2.1 Matrix inverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

ii

3.2.2 Matrix functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

3.3

Exercises

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 4

Introduction to programming in MATLAB

35

4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

4.2 M-File Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

4.2.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

4.2.2 Script side-e®ects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

4.3 M-File functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

4.3.1 Anatomy of a M-File function . . . . . . . . . . . . . . . . . . . . . . 38

4.3.2 Input and output arguments . . . . . . . . . . . . . . . . . . . . . . . 40

4.4 Input to a script ¯le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

4.5 Output commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

4.6

Exercises

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 5

Control °ow and operators

43
5.1

Introduction

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 5.2

Control °ow

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

5.2.1 The``if...end''structure . . . . . . . . . . . . . . . . . . . . . . . 43

5.2.2 Relational and logical operators . . . . . . . . . . . . . . . . . . . . . 45

5.2.3 The``for...end''loop . . . . . . . . . . . . . . . . . . . . . . . . . 45

5.2.4 The``while...end''loop . . . . . . . . . . . . . . . . . . . . . . . 46

5.2.5 Other °ow structures . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

5.2.6 Operator precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

5.3

Saving output to a ¯le

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 5.4

Exercises

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 6

Debugging M-¯les

49
6.1

Introduction

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 6.2

Debugging process

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

6.2.1 Preparing for debugging . . . . . . . . . . . . . . . . . . . . . . . . . 50

6.2.2 Setting breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

iii

6.2.3 Running with breakpoints . . . . . . . . . . . . . . . . . . . . . . . . 50

6.2.4 Examining values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

6.2.5 Correcting and ending debugging . . . . . . . . . . . . . . . . . . . . 51

6.2.6 Ending debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

6.2.7 Correcting an M-¯le . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

A

Summary of commands

53
B

Release notes for Release 14 with Service Pack 2

58
B.1

Summary of changes

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 B.2

Other changes

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 B.3

Further details

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 C

Main characteristics of MATLAB

62
C.1

History

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 C.2

Strengths

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 C.3

Weaknesses

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 C.4

Competition

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 iv

List of Tables

1.1 Basic arithmetic operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.2 Hierarchy of arithmetic operations . . . . . . . . . . . . . . . . . . . . . . . . 7

2.1 Elementary functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.2 Prede¯ned constant values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.3 Attributes forplot. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.4 Elementary matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

2.5 Special matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

3.1 Array operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

3.2 Summary of matrix and array operations . . . . . . . . . . . . . . . . . . . . 32

3.3 Matrix functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

4.1 Anatomy of a M-File function . . . . . . . . . . . . . . . . . . . . . . . . . . 38

4.2 Di®erence between scripts and functions . . . . . . . . . . . . . . . . . . . . 39

4.3 Example of input and output arguments . . . . . . . . . . . . . . . . . . . . 40

4.4dispandfprintfcommands . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.1 Relational and logical operators . . . . . . . . . . . . . . . . . . . . . . . . . 45

5.2 Operator precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

A.1

Arithmetic operators and special characters

. . . . . . . . . . . . . . . 53 A.2

Array operators

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 A.3

Relational and logical operators

. . . . . . . . . . . . . . . . . . . . . . 54 A.4

Managing workspace and ¯le commands

. . . . . . . . . . . . . . . . . 55 A.5

Prede¯ned variables and math constants

. . . . . . . . . . . . . . . . . 55 v A.6

Elementary matrices and arrays

. . . . . . . . . . . . . . . . . . . . . . 56 A.7

Arrays and Matrices: Basic information

. . . . . . . . . . . . . . . . . 56 A.8

Arrays and Matrices: operations and manipulation

. . . . . . . . . . 56 A.9 Arrays and Matrices: matrix analysis and linear equations . . . . . 57 vi

List of Figures

1.1 The graphical interface to the MATLAB workspace . . . . . . . . . . . . . . 3

2.1 Plot for the vectors x and y . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.2 Plot of the Sine function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

2.3 Typical example of multiple plots . . . . . . . . . . . . . . . . . . . . . . . . 17

vii

Preface

\Introduction to MATLAB for Engineering Students" is a document for an introductory course in MATLAB R°1and technical computing. It is used for freshmen classes at North- western University. This document is not a comprehensive introduction or a reference man- ual. Instead, it focuses on the speci¯c features of MATLAB that are useful for engineering classes. The lab sessions are used with one main goal: to allow students to become familiar with computer software (e.g., MATLAB) to solve application problems. We assume that the students have no prior experience with MATLAB. The availability of technical computing environment such as MATLAB is now reshaping the role and applications of computer laboratory projects to involve students in more intense problem-solving experience. This availability also provides an opportunity to easily conduct numerical experiments and to tackle realistic and more complicated problems. Originally, the manual is divided into computer laboratory sessions (labs). The lab document is designed to be used by the students while working at the computer. The emphasis here is \learning by doing". This quiz-like session is supposed to be fully completed in 50 minutes in class. The seven lab sessions include not only the basic concepts of MATLAB, but also an in- troduction to scienti¯c computing, in which they will be useful for the upcoming engineering courses. In addition, engineering students will see MATLAB in their other courses. The end of this document contains two useful sections: a Glossary which contains the brief summary of the commands and built-in functions as well as a collection of release notes. The release notes, which include several new features of the Release 14 with Service Pack

2, well known as R14SP2, can also be found in Appendix. All of the MATLAB commands

have been tested to take advantage with new features of the current version of MATLAB available here at Northwestern (R14SP2). Although, most of the examples and exercises still work with previous releases as well. This manual re°ects the ongoing e®ort of the McCormick School of Engineering and Applied Science leading by Dean Stephen Carr to institute a signi¯cant technical computing in the Engineering First

R°2courses taught at Northwestern University.

Finally, the students - Engineering Analysis (EA) Section - deserve my special grati- tude. They were very active participants in class.

David Houcque

Evanston, Illinois

August 2005

1 MATLABR°is a registered trademark of MathWorks, Inc.

2Engineering FirstR°is a registered trademark of McCormick

School of Engineering and Applied Science (Northwestern University) viii

Acknowledgements

I would like to thank Dean Stephen Carr for his constant support. I am grateful to a number of people who o®ered helpful advice and comments. I want to thank the EA1 instructors (Fall Quarter 2004), in particular Randy Freeman, Jorge Nocedal, and Allen Ta°ove for their helpful reviews on some speci¯c parts of the document. I also want to thank Malcomb MacIver, EA3 Honors instructor (Spring 2005) for helping me to better understand the animationof system dynamics using MATLAB. I am particularly indebted to the many students (340 or so) who have used these materials, and have communicated their comments and suggestions. Finally, I want to thank IT personnel for helping setting up the classes and other computer related work: Rebecca Swierz, Jesse Becker, Rick Mazec, Alan Wol®, Ken

Kalan, Mike Vilches, and Daniel Lee.

About the author

David Houcque has more than 25 years' experience in the modeling and simulation of struc- tures and solid continua including 14 years in industry. In industry, he has been working as R&D engineer in the ¯elds of nuclear engineering, oil rig platform o®shore design, oil reser- voir engineering, and steel industry. All of these include working in di®erent international environments: Germany, France, Norway, and United Arab Emirates. Among other things, he has a combined background experience: scienti¯c computing and engineering expertise. He earned his academic degrees from Europe and the United States. Here at Northwestern University, he is working under the supervision of Professor Brian Moran, a world-renowned expert in fracture mechanics, to investigate the integrity assess- ment of the aging highway bridges under severe operating conditions and corrosion. ix

Chapter 1

Tutorial lessons 1

1.1

Introduction

The tutorials are independent of the rest of the document. The primarily objective is to help you learnquicklythe ¯rst steps. The emphasis here is \learning by doing". Therefore, the best way to learn is by trying it yourself. Working through the examples will give you a feel for the way that MATLAB operates. In this introduction we will describe how MATLAB handles simple numerical expressions and mathematical formulas. The name MATLAB stands for MATrix LABoratory. MATLAB was written originally to provide easy access to matrix software developed by the LINPACK (linear system package) and EISPACK (Eigen system package) projects. MATLAB [1] is a high-performance language for technical computing. It integrates computation,visualization, andprogrammingenvironment. Furthermore, MATLAB is a modern programming language environment: it has sophisticateddata structures, contains built-in editing anddebugging tools, and supportsobject-oriented programming. These factors make MATLAB an excellent tool for teaching and research. MATLAB has many advantages compared to conventional computer languages (e.g., C, FORTRAN) for solving technical problems. MATLAB is an interactive system whose basic data element is anarraythat does not require dimensioning. The software package has been commercially available since 1984 and is now considered as a standard tool at most universities and industries worldwide. It has powerfulbuilt-inroutines that enable a very wide variety of computations. It also has easy to use graphics commands that make the visualization of results immediately available. Speci¯c applications are collected in packages referred to astoolbox. There are toolboxes for signal processing, symbolic computation, control theory, simulation, optimiza- tion, and several other ¯elds of applied science and engineering. In addition to the MATLAB documentation which is mostly available on-line, we would 1 recommend the following books: [2], [3], [4], [5], [6], [7], [8], and [9]. They are excellent in their speci¯c applications. 1.2

Basic features

As we mentioned earlier, the followingtutoriallessons are designed to get you started quickly in MATLAB. The lessons are intended to make you familiar with the basics of MATLAB. We urge you to complete theexercisesgiven at the end of each lesson. 1.3

A minimum MATLAB session

The goal of thisminimumsession (also calledstartingandexitingsessions) is to learn the

¯rst steps:

How to log on

Invoke MATLAB

Do a few simple calculations

How to quit MATLAB

1.3.1 Starting MATLAB

After logging into your account, you can enter MATLAB by double-clicking on the MATLAB shortcuticon(MATLAB 7.0.4) on your Windows desktop. When you start MATLAB, a special window called the MATLAB desktop appears. The desktop is a window that contains otherwindows. The major tools within or accessible from the desktop are:

TheCommand Window

TheCommand History

TheWorkspace

TheCurrent Directory

TheHelp Browser

TheStartbutton

2 Figure 1.1: The graphical interface to the MATLAB workspace 3 When MATLAB is started for the ¯rst time, the screen looks like the one that shown in the Figure 1.1. This illustration also shows the default con¯guration of the MATLAB desktop. You can customize the arrangement of tools and documents to suit your needs. Now, we are interested in doing some simple calculations. We will assume that you have su±cient understanding of your computer under which MATLAB is being run. You are now faced with the MATLAB desktop on your computer, which contains the prompt (>>) in the Command Window. Usually, there are 2 types of prompt: >> for full version

EDU> for educational version

Note: To simplify the notation, we will use this prompt,>>, as a standard prompt sign, though our MATLAB version is for educational purpose.

1.3.2 Using MATLAB as a calculator

As an example of a simple interactive calculation, just type the expression you want to evaluate. Let's start at the very beginning. For example, let's suppose you want to calculate the expression, 1 + 2£3. You type it at the prompt command (>>) as follows, >> 1+2*3 ans = 7 You will have noticed that if you do not specify an output variable, MATLAB uses a default variableans, short foranswer, to store the results of the current calculation. Note that the variableansis created (or overwritten, if it is already existed). To avoid this, you may assign a value to a variable or output argument name. For example, >> x = 1+2*3 x = 7 will result inxbeing given the value 1 + 2£3 = 7. This variable name can always be used to refer to the results of the previous computations. Therefore, computing 4xwill result in >> 4*x ans =

28.0000

Before we conclude this minimum session, Table 1.1 gives the partial list of arithmetic operators. 4

Table 1.1: Basic arithmetic operators

Symbol Operation Example

quotesdbs_dbs7.pdfusesText_13
[PDF] functional structure

[PDF] fundamentals of corporate finance pdf

[PDF] fundamentos de administracion y gestion

[PDF] fundamentos de gestión empresarial

[PDF] fundamentos de gestion empresarial definicion

[PDF] fundamentos de gestion empresarial enfoque basado en competencias pdf

[PDF] fundamentos de gestion empresarial enfoque basado en competencias pdf gratis

[PDF] fundamentos de gestion empresarial julio garcia del junco pdf

[PDF] fundamentos de gestion empresarial libro

[PDF] fundamentos de gestion empresarial mc graw hill pdf

[PDF] fundamentos de gestión empresarial pearson pdf

[PDF] fundamentos de gestion empresarial unidad 1

[PDF] fundamentos de marketing kotler 13 edicion pdf

[PDF] fundamentos de marketing kotler 14 edicion pdf

[PDF] fundamentos de marketing kotler 8va edicion pdf