In: Mechanical Engineering
Use MATLAB to plot the polynomials y = 3x4 - 6x3 + 8x2 + 4x + 90 and z = 3x3 + 5x2 - 8x + 70 over the interval -3 ≤ x ≤ 3. Properly label the plot and each curve. The variables y and z represent current in milliamperes; the variable x represents voltage in volts.
MATLAB syntax of the following is as follows:
>> a1 = [3,-6,8,4,90];
a2 = [3, 5, -8, 70];
x=[-3:0.01:3];
y = polyval(a1,x);
z = polyval(a2,x);
>> plot(x,y,x,z,\'--\');
>> xlabel(\'Voltage Volts\');
>> ylabel(\'Current milliamps\')
MATLAB plot is:
MATLAB syntax of the following is:
>> a1 = [3,-6,8,4,90];
a2 = [3, 5, -8, 70];