How to assign the size of a k-th column of a cell to the k+1-th?

2 次查看(过去 30 天)
Hi everybody,
I need to assign the size of the k-th column of a cell to the k+1-th in a for loop. This form seems not to work because the index exceeds the number of array elements (1).
sbc{k}=size(cycles{k+1});
  5 个评论

请先登录,再进行评论。

回答(1 个)

Rik
Rik 2021-9-29
When you execute this line:
sbc{k}=size(cycles{k+1})
the k+1 element of cycles doesn't exist yet. You will have to make sure your loop starts 1 later and does sbc{k-1}.
Alternatively you can use a second loop that runs up N-1.

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by