Hey all, I want to fill all NaNs in the column named tm_m in the all tables that store in a 1 x 71 cell array named C using an average of the exact row of 2 other columns named tmax_m and tmin_m. I read the Matlab help and I thought this must work but it gave me an error:
for i=1:length(C) if any(contains(C{i}.Properties.VariableNames,'tm_m')) C{i}{C{i}{:,'tm_m'}=NaN, 'tm_m'} = mean([C.tmax_m(isnan(C.tm_m)), C.tmin_m(isnan(C.tm_m))],2); endend
the error is :
C{i}{C{i}{:,'tm_m'}=NaN, 'tm_m'} = mean([C.tmax_m(isnan(C.tm_m)), C.tmin_m(isnan(C.tm_m))],2); ↑Error: Incorrect use of '=' operator. To assign a value to avariable, use '='. To compare values for equality, use '=='.
Thank you.
Best Answer