THE MATLAB ENVIRONMENT VARIABLES BASIC COMMANDS HELP HP 100 – MATLAB Wednesday, 8/27/2014 www.clarkson.edu/class/honorsmatlab.

Slides:



Advertisements
Similar presentations
Introduction to MATLAB The language of Technical Computing.
Advertisements

Introduction to Matlab Workshop Matthew Johnson, Economics October 17, /13/20151.
Introduction to MATLAB for Biomedical Engineering BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Lesson 2: Element-wise vs. matrix operations.
Chapter 1 Computing Tools Data Representation, Accuracy and Precision Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
EGR 106 – Week 2 – Arrays Definition, size, and terminology Construction methods Addressing and sub-arrays Some useful functions for arrays Character arrays.
Introduction to MATLAB Week 13 – 4/21/09. Instructor: Kate Musgrave Time: Tuesdays 3-5pm Office Hours: Tuesdays 1:30-3pm
EGR 106 – Week 2 – Arrays & Scripts Brief review of last week Arrays: – Concept – Construction – Addressing Scripts and the editor Audio arrays Textbook.
Division Example 2x - 3y + 4z = 10 x + 6y - 3z = 4 -5x + y + 2z = 3 A*X = B where A = B = >> X = A\B X =
Basic Input/Output and Variables Ethan Cerami New York
Introduction to MATLAB ENGR 1187 MATLAB 1. Programming In The Real World Programming is a powerful tool for solving problems in every day industry settings.
Part 1 Chapter 2 MATLAB Fundamentals
MATLAB Fundamentals.
1 MATLAB 基礎. 2 MATLAB  Workspace: environment (address space) where all variables reside  After carrying out a calculation, MATLAB assigns the result.
Lecture 1: Introduction Lecture series based on the text: Essential MATLAB for Engineers and Scientists By Hahn & Valentine
Introduction to Access By Mary Ann Chaney and Alicia Harkleroad.
1 Chapter 1 MATLAB Primer This introductory chapter is relatively short and has as its main objective the introduction of MATLAB ® to the reader. This.
Data, graphics, and programming in R 28.1, 30.1, Daily:10:00-12:45 & 13:45-16:30 EXCEPT WED 4 th 9:00-11:45 & 12:45-15:30 Teacher: Anna Kuparinen.
Lecture 4 MATLAB Windows Arithmetic Operators Maintenance Functions
IC3003 B ASIC S CIENTIFIC C OMPUTING Lecture 1 Monday 08:30-11:30 U204a.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
1 Lab of COMP 406 Teaching Assistant: Pei-Yuan Zhou Contact: Lab 1: 12 Sep., 2014 Introduction of Matlab (I)
MEGN 536 – Computational Biomechanics MATLAB: Getting Started Prof. Anthony J. Petrella Computational Biomechanics Group.
SPREADSHEET BASICS SPREADSHEET BASICS What are the benefits of using a spreadsheet to solve a problem?
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
ENG 1181 College of Engineering Engineering Education Innovation Center MATLAB is a powerful program for numerical computations, plotting and programming.
Introduction to MATLAB ENGR 1181 MATLAB 1. Programming In The Real World Programming is a powerful tool for solving problems in every day industry settings.
Introduction to Engineering MATLAB – 1 Introduction to MATLAB Agenda Introduction Arithmetic Operations MATLAB Windows Command Window Defining Variables.
MATLAB FUNDAMENTALS: MATRIX/ARRAY FUNCTIONS THE COLON MATRIX/ARRAY MANIPULATION INPUT/OUTPUT HP 100 – MATLAB Wednesday, 9/3/2014
Chapter 1: Getting Started with MATLAB MATLAB for Scientist and Engineers Using Symbolic Toolbox.
What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation tools. Others include Maple Mathematica MathCad.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
Introduction to Engineering MATLAB – 2 Introduction to MATLAB - 2 Agenda Defining Variables MATLAB Windows.
CMPS 1371 Introduction to Computing for Engineers MatLab.
10/24/20151 Chapter 2 Review: MATLAB Environment Introduction to MATLAB 7 Engineering 161.
MATLAB Environment ELEC 206 Computer Applications for Electrical Engineers Dr. Ron Hayne.
Winter Semester 2014/2015 College of Engineering.
Introduction to MATLAB ENGR 1181 MATLAB 1. Opening MATLAB  Students, please open MATLAB now.  CLICK on the shortcut icon → Alternatively, select… start/All.
ES 240: Scientific and Engineering Computation. Chapter 2 Chapter 2: MATLAB Fundamentals Uchechukwu Ofoegbu Temple University.
ME6104: CAD. Module 4. ME6104: CAD. Module 4. Systems Realization Laboratory Module 4 Matlab ME 6104 – Fundamentals of Computer-Aided Design.
1 Week 1: Variables, assignment, expressions READING: 1.2 – 1.4.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 18P. 1Winter Quarter Introduction to MATLAB Lecture 18.
MA/CS 375 Fall 2002 Lecture 3. Example 2 A is a matrix with 3 rows and 2 columns.
INTRODUCTION TO MATLAB MATLAB is a software package for computation in engineering, science, and applied mathemat-ics. It offers a powerful programming.
A string is an array of characters Strings have many uses in MATLAB Display text output Specify formatting for plots Input arguments for some functions.
Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz SUNY-New Paltz “Lecture 2”
1 Lecture 1 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Part 1 Chapter 2 MATLAB Fundamentals PowerPoints organized by Dr. Michael R. Gustafson II, Duke University and Prof. Steve Chapra, Tufts University All.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
ENG 1181 First-Year Engineering Program College of Engineering Engineering Education Innovation Center First-Year Engineering Program MAT - Introduction.
INTRODUCTION TO MATLAB Dr. Hugh Blanton ENTC 4347.
MA/CS 375 Fall 2002 Lecture 2. Motivation for Suffering All This Math and Stuff Try the Actor demo from
Introduction to Programming Python Lab 3: Arithmetic 22 January PythonLab3 lecture slides.ppt Ping Brennan
Matlab for Engineers Matlab Environment Chapter 2.
1 Faculty Name Prof. A. A. Saati. 2 MATLAB Fundamentals 3 1.Reading home works ( Applied Numerical Methods )  CHAPTER 2: MATLAB Fundamentals (p.24)
Introduction to Programming Python Lab 5: Strings and Output 05 February PythonLab5 lecture slides.ppt Ping Brennan
Thinking about programming Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
1 EPIB 698C Lecture 1 Instructor: Raul Cruz-Cano
An Introduction to Programming in Matlab Emily Blumenthal
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
ECE 1304 Introduction to Electrical and Computer Engineering
MATLAB DENC 2533 ECADD LAB 9.
Matlab Workshop 9/22/2018.
Lecture 1: Introduction
INTRODUCTION TO MATLAB
MATLAB Introduction MATLAB can be thought of as a powerful graphing calculator but with a lot more buttons! It is also a programming language, commands.
Matlab Training Session 2: Matrix Operations and Relational Operators
Electrical and Computer Engineering Department SUNY – New Paltz
Presentation transcript:

THE MATLAB ENVIRONMENT VARIABLES BASIC COMMANDS HELP HP 100 – MATLAB Wednesday, 8/27/2014

Who are we?  Jim: Junior Aeronautical – Mechanical Engineer   Joe: Senior Mechanical Engineer 

Quote of the Week “This is a full time campus. Believe me, there’s nothing exciting going on downtown.” Prof. Cetinkaya

Before We Begin:  Any Questions? Comments? Concerns?  Feel free to contact Jim or Joe We can set up small group tutoring or one-on-one You can us with questions or concerns We are here for you! Even if it isn't about MATLAB

Homework  Create and submit a PDF file using the publish tool in Matlab  Feel free to work in groups!  Do NOT have identical code  Questionable integrity will be examined  This is your FIRST & FINAL WARNING

The MATLAB Interface Open MATLAB: Start  All Programs  MATLAB

MATLAB Interface [cont.] Double Click on variable and it will open this “excel” like editor

The Editor  The Editor is a supped up ‘notepad’  It is where you will be spending most of your time.  It allows you to write your code, save it, open it up again, run it as well as many more advance options.  Open it from:  New Script  The “New” icon has options to create other different things like functions and GUIs

The Editor [cont.] Line Number Save & Run script Where MATLAB will try to point out possible errors with your code, and offer suggestions! How nice!

MATLAB FUNDAMENTALS The 'Supped-Up Graphing Calculator' – In the command window: > Result: ans = 30 > – So… what does this mean? You can use the command window like a scratch-pad or calculator, using familiar math symbols. Addition: a + b Multiplication: a * b Subtraction: a - b Division: a / b Exponentiation: a^b

MATLAB FUNDAMENTALS  Order of Operations  Parentheses left to right  Exponents left to right  Division AND Multiplication left to right  Addition AND Subtraction left to right

MATLAB FUNDAMENTALS  Creating Variables / Arrays  The assignment operator= > = >;  Variable names must begin with a letter and can only contain letters, numbers, and the underscore.  Examples:  x = 1;  y = [ ];  z = [1 0 0; 0 1 0; 0 0 1];

MATLAB FUNDAMENTALS  Variables and Arrays  Variables store values (numbers and text)  Scalar  Vector  Array (Matrix)

MATLAB FUNDAMENTALS  Mathematical Operations with arrays  Use.*./.^ when using operation on an array or vector  Array Indexing  Indexing an array is to specify a specific location to extract its value and or to perform an operation.  Arrays are indexed as follows: A(i,j)  Refers to the i th row and j th column. i j

Elementary MATLAB Commands FunctionSyntax (What to type in)Example Display disp(‘Hello’) disp(x) Hello 5 Trig Functions sin(pi/2)1 Square Root sqrt(16)4 Remainder rem(15,6)3 Size d=[1 2 3;4 5 6] size(d) [2 3] Clear clear(Clears all variables) Clear Screen clc(Clears Screen)

Numerical Display  See page 39 in your texts MATLAB CommandDisplayExample format short 4 decimal points format long 14 decimal points format short e 4 decimal points e+000 format long e 14 decimal digits e+000 format bank 2 decimal digits 3.14 format + +, -, blank + format rat Fractional form 355/113

Help command  Help function: Universal!  Solves many problems created by Jim and Joe!!  ‘help’ is a great place to start when totally lost  ‘help _______’ insert a function in the blank ie cos, solve, plot, etc…  Mathworks website has an explanation for every function in matlab

Publishing  Go to the Publish tab  Click the drop box below the Publish icon and select edit publishing options  Change the output format to PDF  Click the Publish icon

Questions?  Questions?  HW # 1  Due by 5:00 PM, Wednesday September 3 rd, to  You are to submit: PDF file of your published code Make sure to use comments % Question 2.2 Problems: 2.2, 2.3, 2.4

Homework Example  Go to Problem 2.3 in your books  Step 1: Create variables for numbers 1-9  Step 2: Evaluate each equation using only the variables you created  Step 3: Create a 3x3 array containing numbers 1-9  Step 4: Evaluate each equation using only references to the array you created