フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Assignment has more non-singleton rhs dimensions than non-singleton subscripts, please help

1 回表示 (過去 30 日間)
Betty
Betty 2017 年 12 月 11 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi, I have troubles with this error message "Assignment has more non-singleton rhs dimensions than non-singleton subscripts", and I know it is my corrcoef function script I do something wrong with.
Here is my code, thank you, B.
%%Leave one out crossval
patient = 33;
b = 0;
for ii=1:7
XPred = []; YOrig=[];
for i = 1:patient
XPredtmp = regresscells{1,i}(1:10,ii);
YOrigtmp = flexionOriginal{1,i}(1:10,ii);
XPred = [XPred,XPredtmp];
YOrig = [YOrig,YOrigtmp];
end
for i=1:33
vector = 1:33;
vectoruse = setdiff(vector,i);
[R(ii,i),P(ii,i)] = corrcoef(YOrig(:,vectoruse),XPred(:,vectoruse));
b = b+1;
end
end

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 12 月 11 日
corrcoef of two matrices with N columns returns an N x N matrix, but you are attempting to store the output in a scalar.
  2 件のコメント
Betty
Betty 2017 年 12 月 11 日
I see. Do you know how I can fix this?
Walter Roberson
Walter Roberson 2017 年 12 月 11 日
First you need to define the desired output...
But at a guess: reshape those 2d arrays into column vectors.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by