Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1- Create a new script that is called HW10a.m and save it. The script will do the following: Assign x to the input statement that

image text in transcribed

1- Create a new script that is called HW10a.m and save it. The script will do the following: Assign x to the input statement that states the following: 'Enter the value of the diameter:' Declare a sequenced vector t that starts from 0 to 2 with step size of 0.001. Using if-elseif-else statement that would do the following: a. b. c. If 0 20 then plot f(t) = 5cos(10t)*exp(-2t) and show the grid. Hint: use index multiplication for f(t) 10 then plot f(t) = 5exp(2t) and show the grid. i. ii. iii. iv. Else display a message 'Error. The diameter must be a positive value d. Test your code for each of the cases and upload your script as a.m file. 2- Create a new script that is called HW10b.m and save it. The script will do the following: a. Create a random number that goes from O to 5 and assign it to a variable y using the following command y round(rand(1,1)*5); b. Use a switch-case statement that would switch on y such that it will evaluate the following cases: Case 0 display The random number is 0, Case 2 display The random number is 2, i. ii, iv. Otherwise display The random number is odd, c. Test your code for each of the cases and upload your script as a .m file

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions

Question

Explain the meaning of the term interest rate risk.

Answered: 1 week ago

Question

What is the process for adding a validation rule to a field?

Answered: 1 week ago

Question

Advance warning and an explanation for the layoff.

Answered: 1 week ago