0%

Matlab 数据类型转换

cell 转字符串:string();

字符串转 double: str2double();

矩阵下标与索引的转换:

下标转索引: sub2ind
索引转下标: ind2sub

1
2
linearInd = sub2ind(matrixSize, rowSub, colSub);
[rowSub, colSub] = ind2sub(matrixSize, linearInd);