Iterating over Columns/Rows (no index)
显示 更早的评论
Standard way to iterate over matrix columns or rows is to use an incrementing iterator and index the matrix from there.
Are there alternative ways to do this?
Similar to iterating over vector values, like this:
for value = some_vector
...
end
回答(1 个)
Yongjian Feng
2021-11-21
编辑:Yongjian Feng
2021-11-21
If the array is a row vector, then it works
a = [1 2 3]
for i = a
disp(i)
end
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!