DOC PREVIEW
MSU ME 451 - Matlab Workshop

This preview shows page 1-2-3-4 out of 12 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Revised: January 13, 2006 Math and MATLAB WorkshopRevised: January 13, 2006 MW(1) Matlab Workshop Introduction to Matlab Matlab is the industry-standard technical computing environment with capabilities in numeric computation and visualization. It integrates the key requirements of a technical computing system: numeric computation, graphics and application-specific tools, and cross-platform capabilities. Matlab provides a versatile environment that has reached an enormous range of users in academia, industry, and government. Over one thousand universities around the world use Matlab for research and in their education curricula, while hundreds of companies design, model, simulate and analyze systems with these same tools. In addition to use in the Vibration and Control Laboratory, Matlab can be used on the PC and UNIX Networks throughout the Engineering Building. In this workshop you will experiment with the most commonly used functions and features of Matlab used in the ME 451 lab. You will perform the basic mathematical procedures required of system and control analysis using both conventional methods and the numerical tools provided by Matlab. Matlab Features Command Window - The default window that opens when you start is named the Command window. Matlab commands can be entered on the command line and executed one at a time. Scripts – Scripts are Matlab program files executed by the Matlab command interpreter. Any valid command for the command window can be included as a line in a Matlab script file. Although you could do all your work on the command line, it is not advisable, because, commands must be entered one line at a time. The preferred way of working with Matlab is to prepare and execute a script file in text format with the suffix “m”. A script file contains a simple text of Matlab commands listed line by line. The commands are executed when the script file is executed by typing the filename into Matlab’s command window. Normally these script files are developed by testing each of the script’s commands in the command window and then adding each tested command to the script file. The sequence of tested commands can then be executed without repeatedly entering many commands on the command line while having to retype the entire line when you make a spelling error. You can use a script, write as many commands as you like then execute them all at once. Using scripts provides a text file that documents your work. If you use the command line, there is no permanent record of the commands you entered. Never use the command line when you can use a script instead!Math and Matlab Short Form Report Revised: January 13, 2006 MW(2) Selected Matlab Functions % - Comments can be inserted on any Matlab line by proceeding them with the “%” character. The % character for documentation; Matlab does not evaluate any text on a line following the % character. help – Information about any Matlab function can be displayed on the screed by entering help < function_name> Matlab has extensive help on all commands. To see some of Matlabs features, Find the command window with the “>>” showing and type the command help demo. Matlab will return text in the command window documenting the command demo. Information regarding plotting with Matlab can be found with the command help plot. plot - Matlab has powerful plotting capabilities. You can plot many lines on one graph, add a title, axis labels, a grid... ode23/ode45 - The Matlab command ode23 and ode45 integrate a set of an ordinary differential equations (ODE). You must create one m-file that defines the ODE and a second m-file to call the ODE using the ode23 or ode45 commands. lsim - The lsim command is similar to the ode23 command, but can only evaluate linear ODEs. However, when you are analyzing a linear ODE, lsim is much easier to implement than ode23 or ode45. step - The step command computes the unit step response of a system. The system can be defined by a transfer function or in state space formulation. This command is most commonly used in the 451 course. conv - The conv function multiplies two polynomials algebraically. This function is useful when computing the response of two transfer functions in series. series - The series command is a special controls application command. It computes the equivalent transfer function of two transfer functions in series. It does the same thing as the conv command but for both the numerator and denominator at once. feedback - The feedback command is similar to the series command, except that it computes the equivalent transfer function of a feed forward and a feedback transfer function.Math and Matlab Short Form Report Revised: January 13, 2006 MW(3) Procedure Follow these procedures and answer the questions on the attached short form. Be sure to attach both the Matlab scripts and the output to the short form. 0. Start Matlab Use either the “Matlab” entry in the “Programs” list in the “Start” menu or The “Matlab” icon on the desktop to start the Matlab program on the computer 1. Linear Algebra – Matrix and Vector Computations: The multiplication of matrix and vector quantities always involves multiplication of a row vector and a column vector. Your TA will supply two vectors and two matrices. 1.0 Record the vectors and matrices supplied by your lab consultant on your short form report Multiplication of Two Vectors Define the two vectors aand b =4321aaaaa and =4321bbbbb The vector ais made up of the scalar quantities ia . It is not possible to multiply two “column” vectors directly. There are two possible “row time column” products of aand b , [ ]44332211432143214321'4321' bababababbbbaaaabbbbaaaa+++===ba and [ ]44332211432143214321'4321' ababababaaaabbbbaaaabbbb+++===ab The single quote operator (‘) on the vector is the “transpose” operator that switches to columns of a vector or matrix to rows. The following vector quantity notations are equivalent: transpose (a) =a’ = aT. 1.1 Perform the product of two vectors in your short form using only your pen or pencil. – no Matlab yet.Math and


View Full Document

MSU ME 451 - Matlab Workshop

Documents in this Course
ME451_L5

ME451_L5

10 pages

HW2

HW2

2 pages

Load more
Download Matlab Workshop
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Matlab Workshop and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Matlab Workshop 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?