subject
Engineering, 14.12.2019 02:31 yyyyyyyyy8938

Write your own implementation of polyval function and name it my_polyval
here is a simple example showiing how polyval function works -

evaluate the polynomial p(x)=3x²+2x+1 at the points 5,7,9 the polynomial coefficients can be represented by the vector [3 2 1].

p = [3 2 1];
x = [5 7 9];
y = polyval(p, x)
y = 1×3
86 162 262
my_polyval needs to be generic. you do not have to use varargin for implementing this, as the function always has two input arguments p and x which are vectors
function:
function y = my_polyval(p, x)
code to call function:
x = [5,7,9];
p1 = [3,2,1];
y1 = my_polyval(p1,x)
p2 = [4,3,2,1];
y2 = my_polyval(p2,x)

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Ariver flows from north to south at 8 km/h. a boat is to cross this river from west to east at a speed of 20 km/h (speed of the boat with respect to the earth/ground). at what angle (in degrees) must the boat be pointed upstream such that it will proceed directly across the river (hint: find the speed of the boat with respect to water/river)? a 288 b. 21.8 c. 326 d. 30.2
Answers: 3
question
Engineering, 04.07.2019 18:10
Assuming compressible flow of air and that the measurements are done at flagstaff a pitot static tube that gives the difference of total and static pressure measures 0.35 m of mercury. what is the velocity of air? assume the temperature to be 300k. (submit your excel or matlab calculation sheet)
Answers: 1
question
Engineering, 04.07.2019 18:10
Awall of 0.5m thickness is to be constructed from a material which has average thermal conductivity of 1.4 w/mk. the wall is to be insulated with a material having an average thermal conductivity of 0.35 w/mk so that heat loss per square meter shall not exceed 1450 w. assume inner wall surface temperature of 1200°c and outer surface temperature of the insulation to be 15°c. calculate the thickness of insulation required.
Answers: 3
question
Engineering, 04.07.2019 19:20
Determine (a) the maximum thermal efficiency of reversible power cycles operating between a hot reservoir at 1000°c and a cold reservoir at 200°c and (b) the maximum cops for reversible refrigeration and heat pump cycies, respectively, between 28°c and 14°c.
Answers: 1
You know the right answer?
Write your own implementation of polyval function and name it my_polyval
here is a simple exam...
Questions
question
English, 24.07.2019 22:40
question
Physics, 24.07.2019 22:40
Questions on the website: 13722363