Hi I have a 3D array and I am trying find the median with nans excluded. I used the nanmedian function but i get the error 'Unexpected MATLAB expression'for the line I have commented out. Could you tell me why? How can i make it right?
for i=1:size(tempBeforeDelam,1) %
for j=1:size(tempBeforeDelam,2) % if(abs((tempBeforeDelam(i,j,1)-tempBeforeDelam(i,j,2)))< 1 && abs((tempBeforeDelam(i,j,2)-tempBeforeDelam(i,j,3))) < 1 && abs((tempBeforeDelam(i,j,3)-tempBeforeDelam(i,j,4))) < 1 && abs((tempBeforeDelam(i,j,4)-tempBeforeDelam(i,j,5))) < 1 && abs((tempBeforeDelam(i,j,5)-tempBeforeDelam(i,j,1))) < 1) %
% beforeDelam(m,n)= nanmedian[tempBeforeDelam(i,j,1) tempBeforeDelam(i,j,2) tempBeforeDelam(i,j,3) tempBeforeDelam(i,j,4) tempBeforeDelam(i,j,5)]
% end endend
Best Answer