Iterating over Columns/Rows (no index)
3 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!