M1-Intro-Matlab (1).pptx - CMPSC 201 Lecture M1...

Info icon This preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPSC 201 Lecture M1 Introduction to MATLAB Book chapter 2
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Objectives Be able to describe the components of MATLAB user interface Be able to use the following: Command Window Workspace Array editor Be able to use different operators Be able to create matrices Be able to create, edit, and run m-files Be able to get user input from m-files Be able to generate outputs Be able to call simple functions Martin K.-C. Yeh 2
Image of page 2
MATLAB MATLAB is a program for doing numerical computation. It was originally designed for solving linear algebra type problems using matrices. Its name is derived from MATrix LABoratory
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
MATLAB MATLAB is officially classed as an interpreted language one that does not require compilation. In the MATLAB environment you can develop and execute programs ( scripts ) that contain MATLAB commands. The interactive environment does not require the formal compilation, linking/loading, and execution process described earlier for high-level computer languages.
Image of page 4
Why use MATLAB? MATLAB is an easy introduction language for programming. MATLAB provides a “quick-and-easy” development environment. MATLAB is very useful in many engineering contexts. MATLAB is used in industry.
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Programming with MATLAB Programming is a TRANSFERABLE SKILL Programming concepts are common for all languages. Syntax may change, but usually similar MATLAB is PLATFORM INDEPENDENT Can write software once for many OSes MATLAB can be linked to other software C/C++, Java, Fortran
Image of page 6
The interactive environment Objectives for the MATLAB User Interface How to use the Command window to explore single commands interactively and how to recall earlier commands to be repeated or changed Where to examine the variables and files created in MATLAB How to view and edit data tables created in MATLAB How MATLAB presents graphical data in separate windows How to create scripts to solve simple arithmetic problems
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
The Default Window (R2014 a) Command Window Workspace Window
Image of page 8
Command Window There will be a prompt in the Command Window: >> We can type commands directly into the Command Window, but they are not saved in a file: >> radius = 49; >> radius + 1 ans = 50 >> radius = ‘radius of a circle’; >> radius + 1 ans = 115 98 101 106 118 116 33 112 103 …
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Why does it do this?
Image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern