[MATLAB笔记] NN输入格式处理为cell型

时间序列所需的cell格式调整


num2cell:数组转换为cell


C = num2cell(A) converts array A into cell array C by placing each element of A into a separate cell in C. Array A need not be numeric.


将数组转换成cell,按照每一个元素分成单个cell


C = num2cell(A,dim) splits the contents of A into separate cells of C, where dim specifies which dimensions of A to include in each cell. dim can be a scalar or a vector of dimensions. For example, if A has 2 rows and 3 columns, then:
num2cell(A,1) creates a 1-by-3 cell array C, where each cell contains a 2-by-1 column of A.
按照列划分cell
num2cell(A,2) creates a 2-by-1 cell array C, where each cell contains a 1-by-3 row of A.
按照行划分cell
num2cell(A,[1 2]) creates a 1-by-1 cell array C, where the cell contains the entire array A.
按照1,2维进行划分,还可以按照[1 3]/[2 3]维进行划分


mat2cell: 可以将目标划分为想要的m*n cell



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值