Redefining a variable in a multidimensional array
Mostrar comentarios más antiguos
Hi
I have a multidimenional array of lengths 887x1388x584. The 887 vector is the time vector in this case, and is in the wrong format, and the 1388 and 584 are lat and lon data (for mapping salinity). I have made a seperate vector (1x887) that has been corrected to the rigth time (from days since 1/1/1950 into calender date). My question is how do I translate this into the original array (replacing the time vector currently stored)?
My current code for making the arrray from .nc files is this:
%% Concat Loop
time_all=length(Nfiles);
sss_all=zeros(Nfiles, length(lon1), length(lat1));
for i = 1:Nfiles
ncfiles(i).name %this just helps my OCD in listing the name of the file
time = ncread(ncfiles(i).name, 'time');
sss = ncread(ncfiles(i).name, 'SSS');
sss_all(i, :, :) = sss;
time_all(i)=time;
end
%% SORT OUT TIME into standard date time
cortime=datetime(1950,1,1)+time_all;
I am very confused from reading the support articles how to do such a task. Thanks fr the help in advance!!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Monte Carlo Analysis en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!