Error when trying to modify a code (vectors)
显示 更早的评论
采纳的回答
更多回答(2 个)
Steven Lord
2019-11-16
You can directly use the elements of a vector through indexing. You don't need to extract them into separate variables.
w = [1 4 9] % Sample
v = w(3) - w(2).^2 + w(1) % 9 - 4*4 + 1 = -6
类别
在 帮助中心 和 File Exchange 中查找有关 Work with Components 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!