ME457 Mechatronic System Modeling MICHIGAN STATE UNIVERSITY Matlab® refresher Your objective: to dominate! My objective: to help you dominate!

Slides:



Advertisements
Similar presentations
Introduction to Programming using Matlab Session 2 P DuffourJan 2008.
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.
MATLAB – What is it? Computing environment / programming language Tool for manipulating matrices Many applications, you just need to get some numbers in.
Stata and logit recap. Topics Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with.
Functions.
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 =
Non-Linear Simultaneous Equations
Digital Image Processing Lecture3: Introduction to MATLAB.
Programming For Nuclear Engineers Lecture 12 MATLAB (3) 1.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
EGR 1101 Unit 7 Systems of Linear Equations in Engineering (Chapter 7 of Rattan/Klingbeil text)
January 24, 2005 Lecture 3 - By P. Lin 1 CPET 190 Lecture 3 Problem Solving with MATLAB
Introduction to MATLAB for Engineers, Third Edition William J. Palm III Chapter 8 Linear Algebraic Equations PowerPoint to accompany Copyright © 2010.
MATLAB File Management. MATLAB User File Management Matlab provides a group of commands to manage user files. For more information, type help iofun. pwd.
Introduction to MATLAB for Engineers Third Edition William J. Palm III Chapter 11 MuPAD PowerPoint to accompany Copyright © The McGraw-Hill Companies,
MATLAB Lecture One Monday 4 July Matlab Melvyn Sim Department of Decision Sciences NUS Business School
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
1 Tips for solving Project 1 Reactor SO 3 SO 2 +O 2.
Shell Scripting Introduction. Agenda What is Shell Scripting? Why use Shell Scripting? Writing and Running a Shell Script Basic Commands -ECHO - REM.
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.
Introduction to Engineering MATLAB – 6 Script Files - 1 Agenda Script files.
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
Copyright © The McGraw-Hill Companies, Inc. Introduction to MATLAB for Engineers, Third Edition William J. Palm III Chapter 1 An Overview of MATLAB.
Numerical Computation Lecture 2: Introduction to Matlab Programming United International College.
Chapter 1: Getting Started with MATLAB MATLAB for Scientist and Engineers Using Symbolic Toolbox.
A Brief introduction to MatLAB ($50 - $99 for students)
Introduction To this point MATLAB has been used to answer questions with a numeric value ▫Variables are assigned specific values ▫Answers are numbers MATLAB.
CMPS 1371 Introduction to Computing for Engineers MatLab.
10/24/20151 Chapter 2 Review: MATLAB Environment Introduction to MATLAB 7 Engineering 161.
Copyright 2002, Paradigm Publishing Inc. CHAPTER 12 BACKNEXTEND 12-1 LINKS TO OBJECTIVES Mail Merge Concepts Mail Merge Concepts Mail Merge Wizard Mail.
Introduction to MATLAB
Winter Semester 2014/2015 College of Engineering.
Scientific Computing Introduction to Matlab Programming.
Regensburg, 24. – Introduction to Simulink Pavel Karban University of West Bohemia, Faculty of Electrical Engineering, Department of Theory.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 6 Review: User Defined Functions Introduction to MATLAB 7 Engineering 161.
CSE123 Lecture 3 Files and File ManagementScripts.
Files: By the end of this class you should be able to: Prepare for EXAM 1. create an ASCII file describe the nature of an ASCII text Use and describe string.
Introduction to MATLAB 7
ME 142 Engineering Computation I Exam 3 Review Mathematica.
Introduction to MATLAB Section2, statistics course Third year biomedical dept. Dina El Kholy, Ahmed Dalal.
訊號與系統 廖文淵 德霖技術學院資訊工程系 Introduction to MATLAB.
1 Lecture 4 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Recap Functions with No input OR No output Determining The Number of Input and Output Arguments Local Variables Global Variables Creating ToolBox of Functions.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 2 : Matlab - Getting Started.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
Introduction to Programming on MATLAB Ecological Modeling Course Sep 11th, 2006.
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
Getting started with Matlab: Outline
Matlab Programming for Engineers
Introduction to Matlab
Release Numbers MATLAB is updated regularly
BAHASA PEMROGRAMAN MATLAB as an Engineering Tool & Programming Language a lecture note for Civil Engineering students of PETRA Christian University Doddy.
Appendix B MathScript Basics
Introduction to MATLAB for Engineers, Third Edition
Introduction to MATLAB
Matlab Diary Matlab allows you to keep a log or diary of your work.
MATLAB DENC 2533 ECADD LAB 9.
Systems of Linear Equations in Engineering
Review Make sure current directory is set properly Create a diary
Digital Image Processing
Communication and Coding Theory Lab(CS491)
funCTIONs and Data Import/Export
Using Script Files and Managing Data
Your objective: to dominate! My objective: to help you dominate!
ME 123 Computer Applications I Lecture 5: Input and Output 3/17/03
Presentation transcript:

ME457 Mechatronic System Modeling MICHIGAN STATE UNIVERSITY Matlab® refresher Your objective: to dominate! My objective: to help you dominate!

ME457 Mechatronic System Modeling MICHIGAN STATE UNIVERSITY Some references MATLAB Student Version: Learning MATLAB, The MathWorks, Inc. Introduction to MATLAB 6 for Engineers, W.J.Palm III, McGraw-Hill. Numerical Methods with MATLAB, G.Recktenwald, Prentice Hall.

ME457 Mechatronic System Modeling MICHIGAN STATE UNIVERSITY Key concept: the Workspace (WS) The Workspace (WS) contains all of your currently active variables and relations. These are initially entered by typing commands (most likely). Useful Workspace commands: –Clear : empty the WS –Who (whos) : show what is in the WS –Save : save all WS variables to file –Load : retrieve a particular WS from file

ME457 Mechatronic System Modeling MICHIGAN STATE UNIVERSITY Key concept: WS inputs WORKSPACE

ME457 Mechatronic System Modeling MICHIGAN STATE UNIVERSITY Key concept: WS outputs WORKSPACE

ME457 Mechatronic System Modeling MICHIGAN STATE UNIVERSITY Script files Script files are text files that are created using the MATLAB script file editor. They usually have the suffix.m. A script file can be run from the command line or toolbar. Two items to remember about.m files: –Use “%” to enter comments for your use. –Use “;” at the end of lines to suppress echo printing when the file is run.

ME457 Mechatronic System Modeling MICHIGAN STATE UNIVERSITY More about the Workspace Recording your MATLAB session can be useful for documentation. Useful Workspace commands: –Diary : turn on recording of all text i/o except plots, save into –Diary off : turn off current recording –Path : pointer to current directory –Pathtool : directory browser

ME457 Mechatronic System Modeling MICHIGAN STATE UNIVERSITY A typical session pattern Clear Diary Problem1 { create data etc here …} –Pa= 14.7; R= 245.6; P= 23; Q = (1/R)*(P-Pa); –who Save Problem1Run1 Diary off You now have 2 files: Problem1: a diary of this session Problem1Run1: a WS file that can be used to recover your last state by using a Load command

ME457 Mechatronic System Modeling MICHIGAN STATE UNIVERSITY Solving Linear Algebraic Equations Define a set of linear algebraic equations as follows: A*X = B*U –X is the unknown vector (n x 1) –U is the input vector (m x 1) –A is n x n, B is n x m In the WS define A, B, and U. Then type X= inv(A)*B*U Click here to see an example session: LAExample1LAExample1

ME457 Mechatronic System Modeling MICHIGAN STATE UNIVERSITY Solving Linear Algebraic Equations Dominators know that a unique solution to a problem in linear algebra doesn’t always exist. To investigate before you leap try this: –Use the command det(A) to check the determinant of A. Proceed accordingly. Sometimes we seek insight in the form of eigenvalues of A. Try this: –Type Evals= eig(A). Click here to see an example session: LAExample2LAExample2

ME457 Mechatronic System Modeling MICHIGAN STATE UNIVERSITY Solving Linear Differential State Equations Define a set of linear algebraic equations: Xdot = A*X + B*U –Xdot is the first derivative of X. Create a script (.m) file that defines the equations for MATLAB in a specific format. –for example: LDEEqns1.m Create a script file that controls the solving of the problem. –click to see an example: LDEExample.pdfLDEExample.pdf