1 / 24

ES 100: Introduction to Engineering Use of the Computer

ES 100: Introduction to Engineering Use of the Computer. Log in using your Novell password. If you do not know your password, immediately (now!) see Al Bender in room 342 upstairs. Open MATLAB once you have logged in. A quiz will be given at the end of class. Welcome to the New Course!.

Télécharger la présentation

ES 100: Introduction to Engineering Use of the Computer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ES 100: Introduction to Engineering Use of the Computer Log in using your Novell password. If you do not know your password, immediately (now!) see Al Bender in room 342 upstairs. Open MATLAB once you have logged in. A quiz will be given at the end of class.

  2. Welcome to the New Course! • ES 100 has been substantially revamped as part of an NSF grant entitled “Hands-On Learning in Engineering” • Twelve sections of hands-on lecture/lab (Meets two times per week) • Twelve sections of lab experiments and data collection (Meets four times during the semester) • You need to be signed up for one section of each

  3. Course Information • Attendance is required at all lecture/labs and all experiments and will be tracked with Blackboard. • Every class will include a brief quiz on Blackboard near the beginning of class. The lowest five of these will be dropped. There will be no make-up for quizzes. • There will be homework assigned for every class. Each of the four “lab experiments” will have an associated group assignment.

  4. More course information • Grading will be as follows • 10% Attendance (taken via Blackboard) • 60% Quizzes (Via Blackboard, every class, lowest three dropped) • 30% Lab Exercises & Reports (written group reports) • You will be asked from time to time to fill out a questionnaire. They are not mandatory and will not be used in grading.

  5. Course Objectives The general objectives of this course are to: • Learn how to use MATLAB as a computer programming tool. • Learn how to create simple algorithms and program them to solve problems of engineering interest. • Learn about the application of computers in laboratory experiments using LabVIEW • Use MATLAB to manage data and compare results from experiments and mathematical models • Have fun while learning this useful tool

  6. MATLAB characteristics Advantages of MATLAB for Programming Ease of Use Convenient editor with automatic formatting Platform Independence Predefined Functions Device-Independent Plotting Graphical User Interfaces MATLAB Compiler Available Same Tool for Many Uses Disadvantages of MATLAB for Programming Interpreted (can be slow), Cost

  7. The MATLAB Desktop Set to where you want to store your work (recommend U: Drive)

  8. Change the Current Directory to your U drive. (Click on the ... button, click on the U drive with your name on it, click on OK.) This is where you want to save your classwork because it can be accessed anywhere in the world. You may want to create a new folder named ES 100. Go to File, Preferences, Command Window and change the Numeric display to compact. Make the following changes in MATLAB now

  9. The Command Window

  10. This is where you can work interactively with MATLAB Some commonly used commands ▲ (up arrow) -- returns the previous command. Can be repeated to obtain earlier commands. clc – clears the screen but not the memory whos – shows list of variables and their properties clear – clears the memory but not the screen The Command Window

  11. Enter the following commands into MATLAB >>a=1 >>b = 3 >>a+b >>whos >>a >>b >>ans >>c >>a = 2 >>c = a*b >>a*sqrt(b) >>▲ (up arrow) >>a*sqrt(c) >>a = a + 1 >>clc

  12. The Workspace Window • Shows properties of variables • Can be used to edit values of variables (double click to activate array editor)

  13. The Array Editor The Array Editor is invoked by double-clicking a variable in the Workspace Browser. It allows a user to change the values contained in a variable or array.

  14. The Launch Pad.

  15. The Command History Window Double click on any command to repeat it in the Command Window

  16. The Edit/Debug Window • This is where you write, edit, test and debug your programs (script or “m” files) • You will be using this window A LOT!

  17. Exercise using MATLAB’s Editor Click on Start (in MATLAB), Desktop Tools, Editor and enter the following: % Tree Measurement, dbh = Diameter at Breast Height (that’s how foresters % measure trees) dbh = 24 area=(dbh^2)*pi/4 circ=dbh*pi myStringArea=[‘The tree’s area is ‘ num2str(area)] myStringCirc=[‘The tree’s circumference is ‘ num2str(circ)] disp(myStringArea) disp(myStringCirc) Save as tree.m, execute tree in the Command Window, examine output, add semicolons to tree.m in the Editor, save, rerun in Command, examine

  18. Matlab has excellent plotting capabilities You can create and format a plot from the command widow You can also create and format plots from your program Unless you are creating a program, it is easier to format a plot in the plot window MATLAB plotting

  19. MATLAB plot of sin x versus x.

  20. Plotting Exercise Enter the following into the Command Window >>a = [1 2 3 4 5 6]; >>b=a.^2; >>plot(a,b); >>bar(a,b); See how the figure changed. >>scatter(a,b); See how the figure changed.

  21. Exercise using Array Editor In the Workspace window double click on the variable a Edit the last value to be 8 Go to the Command window and type “a” to show that its last value was changed Type “b” to show that its values have not changed Compare the plots without and with b updated: >>plot(a,b); >>b=a.^2; >>plot(a,b);

  22. The Help Browser

  23. The Path Tool This is where you tell MATLAB where to look for m files when they are named in the Command Window.

  24. Do problems 1.5, 1.6, 1.7, 1.8 yourself. The only way to learn how to use software is lots of practice. Write GPP/PP into a word file for chapters 1 & 2 Note: GPP = Good Programming Practice PP = Potential Pitfalls Read all of Chapter 1 and sections 2.1-2.5,2.8, 2.9 Be prepared for a quiz at the beginning of the next class, based on this assignment. This will also serve to take attendance. Assignment for next lecture

More Related