简体   繁体   English

Matlab下标的分配尺寸不匹配

[英]Matlab Subscripted assignment dimension mismatch

My code is as below: my dbFeaturesTop and side is a matrix of size 700x128. 我的代码如下:我的dbFeaturesTop和side是大小为700x128的矩阵。 May I know which part cause the error please? 我可以知道是哪个部分导致了错误吗? I run this line then error shows. 我运行此行,然后显示错误。

Subscripted assignment dimension mismatch. 下标分配尺寸不匹配。

Error in FYPGUI>btnTrainNeuralNetwork_Callback (line 411)
x ( :, sample ) = [(cell2mat(dbFeaturesTop(sample)))
(cell2mat(dbFeaturesSide(sample)))];

x = zeros ( 2, noOfSamples );
x ( :, sample ) = [(cell2mat(dbFeaturesTop(sample))) (cell2mat(dbFeaturesSide(sample)))]

First store the matrix in a temporary variable: 首先将矩阵存储在一个临时变量中:

tempMat = [(cell2mat(dbFeaturesTop(sample))) (cell2mat(dbFeaturesSide(sample)))];

Print out the size of that matrix. 打印出该矩阵的大小。 The error is that x(:, sample) does not match the dimensions of tempMat. 错误是x(:, sample)与tempMat的尺寸不匹配。 sample should be a vector such that the dimensions should match up. sample应为向量,以便尺寸匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM