【发布时间】:2017-07-24 06:52:43
【问题描述】:
我有一个char数组,例如:
a = '123456abced5421f'
我想将它分成相等的部分(例如:b(1) = '123456ab' 和 b(2) = 'ced5421f'),所以当我调用 b(1) 时,它将返回 8 个元素而不仅仅是 1 个元素。
如何在 Matlab 中做到这一点?
我尝试使用元胞数组和 reshape,元胞数组会增加数组的大小,所以我不想使用它,reshape 只会返回 1 个元素。
【问题讨论】:
-
您可以使用长度。
b = a(1,8)。 Here you can find more Information aboutarray-indexing
标签: arrays matlab matrix split char