60 likes | 72 Vues
Learn how to use MATLAB for computation, visualization, and programming in engineering and science. Create your own programs to perform calculations and display results. Utilize MATLAB's built-in functions and editor for efficient programming.
E N D
MATLAB – What Is It ? • Name is from matrix laboratory • Powerful tool for • Computation and visualization of engineering and science mathematics • Communication of ideas • Programming: • Built-in editor, debugger, and help • Many predefined functions (grouped in toolboxes) • Interpreted or compiled programs
How Do We Want To Use MATLABIn This Course? Write a Simple MATLAB Program to Do the Following: - Perform Particular Calculations • Display/Plot Particular Results for Interpretation
Creating Your Own ProgramScript (m-file) Concept • M-file is a collection of MATLAB commands • Can be re-executed • Is easily changed/modified or e-mailed to someone • File format: Name.m • Commands are executed one by one sequentially • File is executed by typing its name (without .m) • Results appear in the command window (or use ; ) • Can be created using any text editor, but is most easily developed in MATLAB Editor Window
Opens Editor Window to create new program Help menu provides answers to most questions In this window: - type & edit commands- test & run program- save work when finished Boot Up Default MATLAB Window
Semicolon used to suppress output to Command Window – commonly desired Dot needed for element-by-element operation Demo MATLAB CodeCalculate & Plot Equation: y=2x+30x2-2x3
Line Specifiers Change the LookEspecially Handy When Plotting Several Lines on Same GraphUse Help Menu to Find Out More Plotting Line Specifiers