Matlab tutorial course

Slides:



Advertisements
Similar presentations
Lecture 14 User-defined functions Function: concept, syntax, and examples © 2007 Daniel Valentine. All rights reserved. Published by Elsevier.
Advertisements

I weigh 700 N and I am in a spaceship that is pushing up on me with a force of 1100 N. A. What is my mass? B. What is the net force acting on me? C. What.
Matlab tutorial course Exercises 4:. Exercises – for loops Download the scripts loops_example.m and if_else_example.m, run the code Download the function,
E.1 Eclipse. e.2 Installing Eclipse Download the eclipse.installation.exe from the course web site to your computer and execute it. Keep the destination.
How to install the Zelle graphics package
Electrical & Gravitational Force. Newton’s Universal Law of Gravitation Every object in the universe attracts every other object with a force that for.
Matlab tutorial course Exercises 1:. Exercises Go back to my webpage, download the file ‘startup.m’ and save it in your MATLAB home folder – Must be directly.
Matlab tutorial course Exercises 2:. Exercises Copy the script ‘face_points.m’ from my webpage into your ‘scripts’ folder Create a new folder in your.
Newton’s Universal Law of Gravitation. Answer Me!!! How does the force of gravity affect objects with similar (very large) masses?
Newton’s Law of Universal Gravitation
Newton’s Law of Gravitation. Newton concluded that gravity was a force that acts through even great distances Newton did calculations on the a r of the.
Newton's law of universal gravitation states that every point mass in the universe attracts every other point mass with a force that is directly proportional.
Newton’s Law of Gravitation. Newton concluded that gravity was a force that acts through even great distances Newton did calculations on the a r of the.
1.  Legend has it that Sir Isaac Newton was struck on the head by a falling apple while napping under a tree. This prompted Newton to imagine that all.
My Documents MarysWebpage 1-WebpageFolders&Files Projects&Assignments MySpinPage SciFairProjPage The folders you should have in “My Documents” are shown.
Newton didn’t discover gravity; he discovered that gravity is universal. Everything pulls on everything else in a simple way that involves only mass and.
Chapter 1: Getting Started with MATLAB MATLAB for Scientist and Engineers Using Symbolic Toolbox.
GRAVITY What goes up, must come down??. Gravity Is it possible for some basketball players to “hang” in the air during a dunk? Give your opinion
Gravity The force of attraction between objects that is due to their masses.
Newton’s Law of Universal Gravitation. What do we know about gravity?
Newton’s Law of Gravitation Chapter 7, Section 3 Pg
MySQL Getting Started BCIS 3680 Enterprise Programming.
Universal Law of Gravitation
Mechanical Engineering Wiki Tutorial for Tech Lit Seung Ki Moon The Department of Industrial Engineering and Mechanical Engineering The.
Gravitation Additional reading: Higher Physics for CfE, p.55 – 63. Notes p.34 Newton’s “Thought Experiment” Sir Isaac Newton, as well as giving us the.
Universal Law of Gravitation. So because of Newton’s 3 rd law every body in the universe exerts a force of attraction on every other body. This is Newton’s.
PHY115 – Sault College – Bazlurslide 1 Gravitational Force.
GRAVITATION NEWTON’S LAW OF GRAVITATION There is an attractive force between any two bodies which is directly proportional to the product of their masses.
Acceleration The rate at which velocity changes. Includes: increasing speed decreasing speed changing direction (with no change in velocity)
Introduction to Literate Programming in Matlab 2WN50 – Week programming-in-matlab.pptx?dl=0.
Newton’s Law of Universal Gravitation
The Law of Universal Gravitation. The legend goes that Sir Isaac Newton developed his theory when an apple fell on his head.
Law of Universal Gravitation Law of Universal Gravitation: gravity is a force of attraction that exists between any two objects that have mass. Force of.
Newton’s Fourth Law Universal Gravitation UniversalUniversal Universal Gravitation.
Newton’s Law of Universal Gravitation
Universal Law of Gravitation. Newton and Gravity Newton and the apple “If gravity attracts an apple toward the Earth, perhaps it also attracts the Moon,
The Solar System The Moon The Earth The Sun How do they move? Why doesn’t the Earth fly away? Photos by NASA.
MySQL Getting Started BCIS 3680 Enterprise Programming.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
NEWTON’S LAW OF UNIVERSAL GRAVITATION Newton’s Law of Universal Gravitation.
Newton’s Law of Gravitation Definition of Newton’s Law of Gravitation: The gravitational force between two bodies is directly proportional to the product.
Physics/Gravity Jeopardy
Unit 2: Forces in Physics
Universal Law of Gravitations, Statics, Coulomb’s Law
Newton’s Law of Universal Gravitation
Newton’s law of Universal Gravitation
“A force of attraction”
Matlab Training Session 4: Control, Flow and Functions
Do you truly understand the gravity of the situation?
2-2-2 Universal Gravitation
Daily Science Weight and mass are not the same thing.
Newton’s Laws of Motion
Universal Law of Gravitation
Newton’s Second Law How does mass affect acceleration? 2.How does mass
Writing functions in MATLAB
UNIT 3 gravitation.
Chapter 5 Matter In Motion
Lesson 1: Newton’s Law of Universal Gravitation
The Law of Universal Gravitation
Chapter 5 Matter In Motion
Describe Gravity in terms of force, mass, and distance
CSCI N207 Data Analysis Using Spreadsheet
Universal Gravitation
Scripts In Matlab.
Newton’s Law of Gravitation
Newton’s Law of Universal Gravitation
Newton’s Law of Universal Gravitation
Matlab tutorial course
Universal Gravitation
Newton’s Law of Universal Gravitation
Presentation transcript:

Matlab tutorial course Exercises 1:

Exercises Go back to my webpage, download the file ‘startup.m’ and save it in your MATLAB home folder Must be directly in ‘Documents/MATLAB’ (not in the TutorialSlides you created earlier) In Matlab->Preferences->Current Folder, click view initial working folder preferences, set your In your Matlab home folder, create a folder ‘code’ Inside this, create two folders: ‘scripts’ and ‘functions’ Close Matlab, then reopen it You should see a welcome message this time (and every time you open Matlab from now on) You can edit ‘startup.m’ to change the welcome message if you like Type ‘path’ in the command window, your folder should have been added Copy ‘my_first_script’ and ‘my_fun’ into the suitable folders Check both script and functions work as before

Exercises Use Matlab to work out how many seconds there are in a year Hint, create variables, num_days, num_hours, etc first… How many seconds are there in 2 years? Or 31 years? Can you write this as a function to compute the number of seconds for any given number of years? Hint your function should have one input (the number of years) and one output – the answer Remember to use expressive function and variable names!

Exercises Lookup ‘Newton's law of universal gravitation’ (yes, you can use wikipedia) Use the command prompt to compute the force of attraction between the moon and the earth You can assume Earth’s mass: 5.97x1024 kg Moon’s mass: 7.35x1022 kg Distance from earth to moon: 380,000km Gravitational constant: 6.674×10−11 N m2 kg−2 Rewrite this as a function that takes as input, M1, M2 and r When you have tried both exercises, go back to my website, in the folder ‘code’ then ‘functions’ you can see my sample answers How did you do?