Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

1- Create a new script that is called HW8.m and save it. The script will do the following: a. Assign x to the input statement that states the following: "Enter the value for size of the pipe diameter:' b. Declare a sequenced vector t that starts from 0 to 4 with step size of 0.001. C. Using if-elseif-else statement that would do the following: i. If 00)&&(x 15 then plot f(t) = 1.5cos(15t)*exp(-2.2t) and show the grid. Hint: use index multiplication for f(t). iv. Else display a message 'Error. The diameter must be a positive value Note that for d. Test your code for each of the cases. e. On the same script, create a random integer that goes from 0 to 5 and assign it to a variable y using the following command: y=round(rand(1,1)*5); f. Use a switch-case statement that would switch on y such that it will evaluate the following cases: i. Case 0 display 'The random number is 0 ii. Case 2 display 'The random number is 2' iii. Case 4 display 'The random number is 4 iv. Otherwise display 'The random number is Odd' g. 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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions

Question

Discuss all branches of science

Answered: 1 week ago