Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Matlab questions q1,q2 needed Homework #1 Create a script (M-file) and name it 'yourname_hwl.m' (ex: oykuerenozsoy_hwl.m). Use MATLAB comments (lines starting with %) to add

Matlab questions q1,q2 needed
image text in transcribed
Homework \#1 Create a script (M-file) and name it 'yourname_hwl.m' (ex: oykuerenozsoy_hwl.m). Use MATLAB comments (lines starting with \%) to add your name and the assignment number to the top of the program and to explain what your code is doing. Choose variable names that describe their contents (for example, a variable named volume makes more sense to the reader of your code than a variable named ddd or variable1) If you are ever unfamiliar with the math involved in a problem, don't hesitate to look it up in a book, on the web, or ask someone. Discussing mathematical formulas is allowed, sharing MATLAB code is not! Submit your M-file using Canvas (Please upload a single M-file including the solutions of both problems. Use the example problem that we solved in the classroom as a basis) Q1) Design a MATLAB program that reads the radius and the height of a cylinder and calculates its volume and its surface area. (Hint: A cylinder's volume is V=r2h, and its surface area is A=2r+2r2 ) Your program must perform the following steps: 1. Prompt the user to enter the radius and the height of the cylinder. 2. Read the inputs (hint: input function). 3. Calculate the volume and write out the result by using the function disp. 4. Calculate the surface area and write out the result by using the function fprintf. Q2) The distance (d) a free-falling object travels is calculated by the equation d=0.5gt2, where g is the acceleration of gravity ( g=9.81m/s2 on the earth, g=1.62m/s2 on the moon) and t is the time in free-fall. a) A skydiver opens his parachute after 5 seconds of free fall. How far does he travel just before deploying his parachute? b) If the maximum time allowed for skydiving before deploying the parachute is 10 seconds, what is the maximum distance he travels in free fall in the air? c) If this person is skydiving on the moon, how far does he travel in 5 seconds

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

3. Define the attributions we use to explain behavior

Answered: 1 week ago