Finding Y vector using a given X vector and a equation
13 次查看(过去 30 天)
显示 更早的评论
I have the equation Y= X^2
Given X = [1:0.5:3]
Calucluate in code the Y Vector
How Do I So .
2 个评论
回答(1 个)
Jess Lovering
2019-10-3
You have to define your vector and then pass it into your equaiton but make sure to use .^ instead of ^ so that it goes element-wise through your equation.
X = [1:0.5:3]
Y = X.^2
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!