MATLAB Answers

0

New user, can someone solve this? I know I need to use colon and element-wise.

Asked by Rodrigo Andrade on 13 Aug 2018
Latest activity Commented on by Rodrigo Andrade on 13 Aug 2018

Create a row vector x that starts at -2, ends at +2 with a step size of 0.5. Use x to create a vector y using the following equation: y = 3x^2 + 2x - 6

  0 Comments

Sign in to comment.

1 Answer

Answer by ES
on 13 Aug 2018
 Accepted Answer

x = -2:0.5:2;%creates an array x with elements -2 to 2 with step size 0.5
y = 3*x.*x + 2*x -6