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

조회 수: 1 (최근 30일)
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

채택된 답변

ES
ES 2018년 8월 13일
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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by