Matlab - Me pueden ayudar a crear el script?

   
Vista:

Me pueden ayudar a crear el script?

Publicado por Monica (36 intervenciones) el 12/06/2014 11:42:04
Estimados, me podrían ayudar a crear el script para este caso? ... esto es para repetir desde el paso de tiempo 1 al 57 el mismo script 'rotate_vec' ..
Las dimensiones de las variables son:
Uinp= 217,146,20,57
Vinp=218,145,20,57
angle=218,146


Uinp=ncread('ocean_his.nc','u');
Vinp=ncread('ocean_his.nc','v');
angle=ncread('roms_grd1.nc','angle');

[Uout1,Vout1]=rotate_vec(Uinp(:,:,:,1),Vinp(:,:,:,1),angle,0);
[Uout2,Vout2]=rotate_vec(Uinp(:,:,:,2),Vinp(:,:,:,2),angle,0);
[Uout3,Vout3]=rotate_vec(Uinp(:,:,:,3),Vinp(:,:,:,3),angle,0);
[Uout4,Vout4]=rotate_vec(Uinp(:,:,:,4),Vinp(:,:,:,4),angle,0);
[Uout5,Vout5]=rotate_vec(Uinp(:,:,:,5),Vinp(:,:,:,5),angle,0);
[Uout6,Vout6]=rotate_vec(Uinp(:,:,:,6),Vinp(:,:,:,6),angle,0);
[Uout7,Vout7]=rotate_vec(Uinp(:,:,:,7),Vinp(:,:,:,7),angle,0);
[Uout8,Vout8]=rotate_vec(Uinp(:,:,:,8),Vinp(:,:,:,8),angle,0);
[Uout9,Vout9]=rotate_vec(Uinp(:,:,:,9),Vinp(:,:,:,9),angle,0);
[Uout10,Vout10]=rotate_vec(Uinp(:,:,:,10),Vinp(:,:,:,10),angle,0);
[Uout11,Vout11]=rotate_vec(Uinp(:,:,:,11),Vinp(:,:,:,11),angle,0);
[Uout12,Vout12]=rotate_vec(Uinp(:,:,:,12),Vinp(:,:,:,12),angle,0);
[Uout13,Vout13]=rotate_vec(Uinp(:,:,:,13),Vinp(:,:,:,13),angle,0);
[Uout14,Vout14]=rotate_vec(Uinp(:,:,:,14),Vinp(:,:,:,14),angle,0);
[Uout15,Vout15]=rotate_vec(Uinp(:,:,:,15),Vinp(:,:,:,15),angle,0);
[Uout16,Vout16]=rotate_vec(Uinp(:,:,:,16),Vinp(:,:,:,16),angle,0);
[Uout17,Vout17]=rotate_vec(Uinp(:,:,:,17),Vinp(:,:,:,17),angle,0);
[Uout18,Vout18]=rotate_vec(Uinp(:,:,:,18),Vinp(:,:,:,18),angle,0);
[Uout19,Vout19]=rotate_vec(Uinp(:,:,:,19),Vinp(:,:,:,19),angle,0);
[Uout20,Vout20]=rotate_vec(Uinp(:,:,:,20),Vinp(:,:,:,20),angle,0);
[Uout21,Vout21]=rotate_vec(Uinp(:,:,:,21),Vinp(:,:,:,21),angle,0);
[Uout22,Vout22]=rotate_vec(Uinp(:,:,:,22),Vinp(:,:,:,22),angle,0);
[Uout23,Vout23]=rotate_vec(Uinp(:,:,:,23),Vinp(:,:,:,23),angle,0);
[Uout24,Vout24]=rotate_vec(Uinp(:,:,:,24),Vinp(:,:,:,24),angle,0);
[Uout25,Vout25]=rotate_vec(Uinp(:,:,:,25),Vinp(:,:,:,25),angle,0);
[Uout26,Vout26]=rotate_vec(Uinp(:,:,:,26),Vinp(:,:,:,26),angle,0);
[Uout27,Vout27]=rotate_vec(Uinp(:,:,:,27),Vinp(:,:,:,27),angle,0);
[Uout28,Vout28]=rotate_vec(Uinp(:,:,:,28),Vinp(:,:,:,28),angle,0);
[Uout29,Vout29]=rotate_vec(Uinp(:,:,:,29),Vinp(:,:,:,29),angle,0);
[Uout30,Vout30]=rotate_vec(Uinp(:,:,:,20),Vinp(:,:,:,30),angle,0);
[Uout31,Vout31]=rotate_vec(Uinp(:,:,:,31),Vinp(:,:,:,31),angle,0);
[Uout32,Vout32]=rotate_vec(Uinp(:,:,:,32),Vinp(:,:,:,32),angle,0);
[Uout33,Vout33]=rotate_vec(Uinp(:,:,:,33),Vinp(:,:,:,33),angle,0);
[Uout34,Vout34]=rotate_vec(Uinp(:,:,:,34),Vinp(:,:,:,34),angle,0);
[Uout35,Vout35]=rotate_vec(Uinp(:,:,:,35),Vinp(:,:,:,35),angle,0);
[Uout36,Vout36]=rotate_vec(Uinp(:,:,:,36),Vinp(:,:,:,36),angle,0);
[Uout37,Vout37]=rotate_vec(Uinp(:,:,:,37),Vinp(:,:,:,37),angle,0);
[Uout38,Vout38]=rotate_vec(Uinp(:,:,:,38),Vinp(:,:,:,38),angle,0);
[Uout39,Vout39]=rotate_vec(Uinp(:,:,:,39),Vinp(:,:,:,39),angle,0);
[Uout40,Vout40]=rotate_vec(Uinp(:,:,:,40),Vinp(:,:,:,40),angle,0);
[Uout41,Vout41]=rotate_vec(Uinp(:,:,:,41),Vinp(:,:,:,41),angle,0);
[Uout42,Vout42]=rotate_vec(Uinp(:,:,:,42),Vinp(:,:,:,42),angle,0);
[Uout43,Vout43]=rotate_vec(Uinp(:,:,:,43),Vinp(:,:,:,43),angle,0);
[Uout44,Vout44]=rotate_vec(Uinp(:,:,:,44),Vinp(:,:,:,44),angle,0);
[Uout45,Vout45]=rotate_vec(Uinp(:,:,:,45),Vinp(:,:,:,45),angle,0);
[Uout46,Vout46]=rotate_vec(Uinp(:,:,:,46),Vinp(:,:,:,46),angle,0);
[Uout47,Vout47]=rotate_vec(Uinp(:,:,:,47),Vinp(:,:,:,47),angle,0);
[Uout48,Vout48]=rotate_vec(Uinp(:,:,:,48),Vinp(:,:,:,48),angle,0);
[Uout49,Vout49]=rotate_vec(Uinp(:,:,:,49),Vinp(:,:,:,49),angle,0);
[Uout50,Vout50]=rotate_vec(Uinp(:,:,:,50),Vinp(:,:,:,50),angle,0);
[Uout51,Vout51]=rotate_vec(Uinp(:,:,:,51),Vinp(:,:,:,51),angle,0);
[Uout52,Vout52]=rotate_vec(Uinp(:,:,:,52),Vinp(:,:,:,52),angle,0);
[Uout53,Vout53]=rotate_vec(Uinp(:,:,:,53),Vinp(:,:,:,53),angle,0);
[Uout54,Vout54]=rotate_vec(Uinp(:,:,:,54),Vinp(:,:,:,54),angle,0);
[Uout55,Vout55]=rotate_vec(Uinp(:,:,:,55),Vinp(:,:,:,55),angle,0);
[Uout56,Vout56]=rotate_vec(Uinp(:,:,:,56),Vinp(:,:,:,56),angle,0);
[Uout57,Vout57]=rotate_vec(Uinp(:,:,:,57),Vinp(:,:,:,57),angle,0);

ncu=cat(4,[Uout1],[Uout2],[Uout3],[Uout4],[Uout5],[Uout6],[Uout7],[Uout8],[Uout9],[Uout10],[Uout11],[Uout12],[Uout13],[Uout14],[Uout15],[Uout16],[Uout17],[Uout18],[Uout19],[Uout20],[Uout21],[Uout22],[Uout23],[Uout24],[Uout25],[Uout26],[Uout27],[Uout28],[Uout29],[Uout30],[Uout31],[Uout32],[Uout33],[Uout34],[Uout35],[Uout36],[Uout37],[Uout38],[Uout39],[Uout40],[Uout41],[Uout42],[Uout43],[Uout44],[Uout45],[Uout46],[Uout47],[Uout48],[Uout49],[Uout50],[Uout51],[Uout52],[Uout53],[Uout54],[Uout55],[Uout56],[Uout57]);

ncv=cat(4,[Vout1],[Vout2],[Vout3],[Vout4],[Vout5],[Vout6],[Vout7],[Vout8],[Vout9],[Vout10],[Vout11],[Vout12],[Vout13],[Vout14],[Vout15],[Vout16],[Vout17],[Vout18],[Vout19],[Vout20],[Vout21],[Vout22],[Vout23],[Vout24],[Vout25],[Vout26],[Vout27],[Vout28],[Vout29],[Vout30],[Vout31],[Vout32],[Vout33],[Vout34],[Vout35],[Vout36],[Vout37],[Vout38],[Vout39],[Vout40],[Vout41],[Vout42],[Vout43],[Vout44],[Vout45],[Vout46],[Vout47],[Vout48],[Vout49],[Vout50],[Vout51],[Vout52],[Vout53],[Vout54],[Vout55],[Vout56],[Vout57]);

Muchas gracias!!
Mónica
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Dave

Me pueden ayudar a crear el script?

Publicado por Dave correa.dave30@gmail.com (934 intervenciones) el 12/06/2014 19:45:26
Hola Monica;

Te sugiero que todo o coloques en un único for.


Espero que sea de alguna ayuda.

Saludos
Dave Correa
correa.dave30@gmail.com
dcorrea@fismatlab.org
Servicios de Programación Matlab
http://fismatlab.org
http://fismatlab.blogspot.com
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar