Dimension Mismatch MatLab; cant figure out why it is mismatching

Posted by Abid on Stack Overflow See other posts from Stack Overflow or by Abid
Published on 2012-04-08T06:12:03Z Indexed on 2012/07/02 21:16 UTC
Read the original article Hit count: 303

I think it may be a syntax issue, here is the code.

  load ([ 'C:\Users\Abid\Desktop\Inquiry Runs\dtS' ])
 dtS((dtS==0))=nan;
 for j=2:9;
maxS=max(dtS(j,:));
minS=min(dtS(j,:));

maxval(j,:)=dtS((dtS>(maxS-.1*maxS)));
minval(j,:)=dtS((dtS<(minS+.1*minS)));

avmax(j)=mean(maxval(j,:));
avmin(j)=mean(minval(j,:));

avs(j,:)=[avmax(j) avmin(j)]
 end

So I know the the row matrices are different sizes every loop. For example maxval(j,:) will change depending one row it is looking through for certain values.

I did this manually and I see that on the first loop the matrices are size (1,1), however, if I set the loop to run for only j=2, the row length is 13.

Usually if a matrix is changing size on the loop, I only get a warning, but this time I think it is due to a reason I don't understand.

© Stack Overflow or respective owner

Related posts about matlab

Related posts about for-loop