For loop from 4-D to 3-D
    3 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Sophia
 el 1 de Mzo. de 2019
  
    
    
    
    
    Respondida: Matt J
      
      
 el 1 de Mzo. de 2019
            yrlst = 2006:2017; 
%12 years of data; each file contains daily dataset for 7 months
for i=1:length(yrlst)
    year0 = yrlst(i);
    fname = strcat('ice_drift_',num2str(year0),'_',num2str(year0+1), '_winter.mat')
    tmp = load(fname);
    long1 = tmp.long;
    lat1 = tmp.lat;
    u1 = tmp.uid;
    v1 = tmp.vid;
    flag1 = tmp.flagid;
    u(i,:,:,:) = u1; %4-D file contains in the order of [12,7,145,73]
    v(i,:,:,:) = v1; %4-D file contains in the order of [12,7,145,73]
    flag(i,:,:,:) = flag1;   
end
%However i want to save them in [12*7,145,73] 
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
				Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

