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

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 16:10, Arealbot
The force on a cutting tool are 2600n vertically downward and 2100 horizontal. determine the resultant force acting on the tool and the angle at which it acts.
Answers: 1
image
Engineering, 04.07.2019 18:10, jadeochoa4466
The temperature of air decreases as it is compressed by an adiabatic compressor. a)- true b)- false
Answers: 2
image
Engineering, 04.07.2019 19:20, Katmcfee7681
Acommercial grade cubical freezer, 4 m on a side, has a composite wall consisting of an exterior sheet of 5.0-mm thick plain carbon steel (kst= 60.5 w/m k), an intermediate layer of 100-mm thick polyurethane insulation (kins 0.02 w/m k), and an inner sheet of 5.0- mm thick aluminium alloy (kal polyurethane insulation and both metallic sheets are each characterized by a thermal contact resistance of r 2.5 x 104 m2 k/w. (a) what is the steady-state cooling load that must be maintained by the refrigerator under conditions for which the outer and inner surface temperatures are 25°c and -5°c, respectively? (b) for power saving purpose, which wall material should be increased/reduced in. thickness in order to reduce 50% of the cooling load found in part (a)? redesign the thickness of the proposed material. 177 w/m-k). adhesive interfaces between the q=575.93 w
Answers: 2
image
Engineering, 04.07.2019 19:20, ameliaxbowen7
List 3 options on how to reduce knocking problens during engine process,
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 in other subjects:

Konu
Health, 05.02.2021 04:50
Konu
Biology, 05.02.2021 04:50
Konu
SAT, 05.02.2021 04:50