Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

From Matlab to C

i have to translate this line from Matlab to C

for i_orient=1:chrOrient

       stack = cat(3,resp{i_orient,:});
       inComp=reshape(stack,r*c,chrScales);
       Tsquared=whitening_sqr_meanDistance(inComp);

what I did is this, but I have to translate the cat function and I don t know why. resp is a MAt object in C

  for(int i_orient=1;i_orient<=achrOrient;i_orient++){
      //stack = cat(3,rpad{i_orient,:});
      inCompImg = stack.reshape(numColComp,rows*cols*achrScales);
      Tsquared=whitening_sqr_meanDistance(inCompImg);
      conspic = Tsquared.reshape(numColComp,rows*cols);