Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 1: Getting Started with MATLAB MATLAB for Scientist and Engineers Using Symbolic Toolbox.

Similar presentations


Presentation on theme: "Chapter 1: Getting Started with MATLAB MATLAB for Scientist and Engineers Using Symbolic Toolbox."— Presentation transcript:

1 Chapter 1: Getting Started with MATLAB MATLAB for Scientist and Engineers Using Symbolic Toolbox

2 You are going to Familiarize yourself with MATLAB desktop, See how simple it is to use MATLAB, yet powerful, Express simple math expressions in MATLAB tongue, Solve mathematical problems using MATLAB, And finally, be glad to know MATLAB is with you. 2

3 Starting MATLAB Start – All Programs – MATLAB – R2009b … Create your own work space. Customize the startup script. 3 Create a new folder under c:\ c:\workM Create a new folder under c:\ c:\workM edit 'startupsav.m'save as 'startup.m' startup.m cd c:\workM disp(['MATLAB v' version]); cd c:\workM disp(['MATLAB v' version]);

4 Overview of MATLAB Desktop 4 Command Window Editor Workspace Command History Window Command History Window Current Folder Current Folder Content Browser Content Browser Show how to use Desktop.

5 Test Ride of MATLAB: bench Type bench in the command window. 5

6 Getting Started with MATLAB Through the demonstration, you will be able to do simple arithmetic operations generating arrays using : operator disable output using ; entering matrices use help systems display the size of matrices perform matrix operations selecting part of matrices plotting matrices 6 Show demo: getting_started_with_matlab.m

7 Working in the Desktop Through the demonstration, you will be able to calculate values for a function plot the results edit the previous commands display the variables using whos modify variables directly using variable editor plot data at workspace browser save and load part / all of the variable adjusting window layouts docking/undocking 7 Show demo: working_with_ide.m

8 Match the pairs. Quiz: MATLAB Windows 8 Main window, enters variables, runs programs. Main window, enters variables, runs programs. Logs commands entered in the Command window. Shows the files in the current directory. Creates and debugs script and function files. Command Window Editor Window Command History Window Command History Window Current Directory Window Current Directory Window

9 MATLAB is a Very Good Calculator! Write down the answers. 9 -4 + 7 * ( 2 - 5 ) / 3.14 2^3 - sqrt(25) + exp(3) 2.51e3 + 2/3*pi Mathematical Expressions Mathematical Expressions MATLAB Expressions MATLAB Expressions Your Answers Your Answers (2+3*i)*(1-2*i)^2

10 Basic Math Expressions 2.1+3coslogroundnchoosekmin 98-3.2acoslog10rembesseljmax -67*34cosdsqrtmodbetasize 81/8acosdabsfactorerfprimes 7.1^4coshangleisprimeerfcgcd 1.2e3acoshconjprimesgammalcd 3+4*itanimaggcdlegendremean piatan2reallcmfactorialroots epsasinfloorratsumpoly expasindceilpermsprodconv 10

11 Exercise: Math Expressions Evaluate the following expressions when x = 1.25 11 >>

12 Exercise: Geometry Find the volume of the oil tank below. 12 MATLAB Expression 20m ANS 24m

13 Variables Assign the results into variables. 13 x = 3^4 + 27^(1/3) y = (2+3i)*(1-2i) z = sqrt( x^2 + y^2 ) ; Do not print the answer!

14 Workspace Variables Variables live in the MATLAB workspace. 14 >> x = 3^4 + 27^(1/3) x = 84 >> y = (2+3i)*(1-2i); >> z = sqrt( x^2 + y^2 ); >> who Your variables are: ans x y z >> clear >> who >> >> x = 3^4 + 27^(1/3) x = 84 >> y = (2+3i)*(1-2i); >> z = sqrt( x^2 + y^2 ); >> who Your variables are: ans x y z >> clear >> who >> who who a* whos clc List variable names. List variable names beginning with a. List variable in long format. Clear command window. clear Clear variables from memory. help doc what

15 Exercise: Geometry & Trigonometry Find the distance between C 2 and C 4. 15 Hint: Use the following identity.

16 Exercise: Your Solution Mathematical Expressions MATLAB Expressions Your Answer: 16

17 Key Takeaways Now, you know how to customize the MATLAB startup script. use the MATLAB desktop windows. change the layout of the desktop windows. evaluate mathematical expressions. 17

18 Q & A 18

19 Notes 19

20 Notes 20


Download ppt "Chapter 1: Getting Started with MATLAB MATLAB for Scientist and Engineers Using Symbolic Toolbox."

Similar presentations


Ads by Google