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, 03.07.2019 14:10
Explain the difference laminar and turbulent flow. explain it with the shear stress and the velocity profiles.
Answers: 1
question
Engineering, 04.07.2019 18:10
Ajournal bearing has a journal diameter of 3.250 in with a unilateral tolerance of 20.003 in. the bushing bore has a diameter of 3.256 in and a unilateral tolerance of 0.004 in. the bushing is 2.8 in long and supports a 700-lbf load. the journal speed is 900 rev/min. find the minimum oil film thickness and the maximum film pressure for both sae 20 and sae 20w-30 lubricants, for the tightest assembly if the operating film temperature is 160°f. a computer code is appropriate for solving this problem.
Answers: 3
question
Engineering, 04.07.2019 18:20
Determine the damped natural frequencies and the steady state response of a decoupled damped forced two degrees of freedom system. 10ä1 + 2q1 20q1 10 cos t; 10q2 +4q2 + 40q2 10 cos t
Answers: 3
question
Engineering, 04.07.2019 18:20
Acertain flow of air (at stp) has a velocity distribution given by v i (in ft/s). if this flow is going through a 4 ft square area in the yz-plane (centered at the origin), what is the mass flow rate (in lbm/s)?
Answers: 2
You know the right answer?
Write your own implementation of polyval function and name it my_polyval
here is a simple exam...
Questions
Questions on the website: 13722367