Hi all,
I have a cell named C. In the C I have 71 tables. Each table has a column named rrr24. I want to run this code below for each rrr24 in the tables and save the results in another cell named C_new.
Here this code which in the first line just uses the first table in the C.
I want the name of each table at the new cell (C_new) to be the name of each table highlighted in the station_name column of each table. Or copy station_name column from each table and paste it as a first column of the same table in the C_new.
I attached C.
Thank you
td = C{1, 1}.rrr24; % example for C{1, 1}
n=length(td);sc_set= [3,6,12,24]; SI=zeros(n,length(sc_set)); for q = 1:length(sc_set) sc = sc_set(k); if length(td(td>=0))/length(td)~=1 SI(n,q)=nan; else SI(1:sc-1,q)=nan; A1=[]; for i=1:sc, A1=[A1,td(i:length(td)-sc+i)]; end Y=sum(A1,2); nn=length(Y); SI1=zeros(nn,1); for k=1:12 d=Y(k:12:nn); nnn=length(d); bp=zeros(nnn,1); for i=1:nnn bp(i,1)=sum(d(:,1)<=d(i,1)); end y=(bp-0.44)./(nnn+0.12); SI1(k:12:nn,1)=y; end SI1(:,1)=norminv(SI1(:,1)); %output
SI(sc:end,q)=SI1; endend
Best Answer