我正在尝试这段代码
arr = [[400, 200], [100, 50]]
for a = arr
a(2) % Should display the 2nd element of the sub-array
end但我得到了:
Index exceeds the number of array elements (1)有什么想法吗?
发布于 2021-05-20 19:51:22
解决方案是以不同的方式定义arr,即:
arr = [400 200; 100 50];https://stackoverflow.com/questions/67619618
复制相似问题