Hi I have the below for loop. I would like to replace the NaN data output with 0.07. I keep getting the below error message. Could anyone please advise me how to stop the error message? Thank you.
for i=1:size(A,2)%number of columns
x{i} = interp1(y3, x3, A(:,i), 'linear');k=1:1;temp=x(k,:);temp(isnan(temp))=0.07;x(k,:)=temp; fid=fopen(['result_' num2str(1) '.txt'],'w'); fprintf(fid,'%f\n',x); fclose(fid);end
The error message:
Undefined function 'isnan' for input arguments of type 'cell'.Error in InterpolaeMFJavadCompleted (line 24)temp(isnan(temp))=0.07;
Best Answer