在 Matlab 中,如果发生错误,我怎样才能跳过某个for
循环索引并跳转continue
到下一个索引?请注意,我不知道哪些for
循环索引会导致错误发生。
错误:Too many outputs requested. Most likely cause is missing [] around left hand side that has a comma separated list expansion
假设在 时发生错误k = 5
。如何使for
循环跳过索引k = 5
和continue
to k = 6
?
for k = 1:10
do stuff
if error occurs
skip k that causes error
go to next k
end
end