Question: 1. Write a script which does the following Use the randi function to obtain 3 integers between -5 and +5, which represent coefficients of a

 1. Write a script which does the following Use the randi

1. Write a script which does the following Use the randi function to obtain 3 integers between -5 and +5, which represent coefficients of a 2nd order polynomial, a, b, c a. b. Print the coefficients as shown below using fprintf. c. Compute the discriminant of the quadratic formula, d b'-40c d. Depending on whether a is zero or non-zero, and whether the discriminant is positive, zero, or negative, compute the roots if they exist and print one of the solution lines below using fprintf. Coefficients a, b, c # xx, xx, xx There is no solution because a-0 The solution has 2 real roots: x.xxx, x.xxx The solution has 1 root:x.xxx The solution has no real roots Your solution will use some combination of if/elseif/else. Run your program multiple times until you see all logic paths exercised. 2. Write a script which does the following: Enter a vector [24 22 20 22 999 25 25 999] which represents temperatures read from an experiment. The measuring system sometimes skips measurements and when it does it inserts the value 999, so it can be distinguished from a valid temperature and filtered out. Test the vector for the existence of any bad values. If there are no bad values do nothing. If there are bad values do the following: a. b. c. i. ii. ili. Determine the number of bad values Modify the vector to omit the bad values Print the following message and the corrected vector: **xx bad values detected and removed [new vector] You should use fprintf to print the first message. You can use disp to print the new vector

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!