Hello guys,
I am trying to do the following operation:
I want to multiply a table of 52824x9, named X, by the first column of a table of 9x4. The table's name is coef, the first column variable name is Estimate. Therefore I would like to do something like this:
I am using the varfun function in the following way:
yPred=varfun(@(x) x.*coef.Estimate,X);
However, I am getting the following message:
Error using tabular/varfun>dfltErrHandler (line 433)
Applying the function '@(x)x.*coef.Estimate' to the variable 'VarName3' generated the following error:
Matrix dimensions must agree.
As I understand, I am multiplying 52824x9*9x1, so I don't know where my mistake is.
If anyone knows how to solve this, or could provide any solution it would be very much appreciated.
Many thanks,
Natalia
댓글 수: 2
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/511802-error-using-varfun-function-matrix-dimensions-must-agree#comment_812386
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/511802-error-using-varfun-function-matrix-dimensions-must-agree#comment_812386
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/511802-error-using-varfun-function-matrix-dimensions-must-agree#comment_812398
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/511802-error-using-varfun-function-matrix-dimensions-must-agree#comment_812398
댓글을 달려면 로그인하십시오.