Commit ba0132f5 authored by Pierre Cazenave's avatar Pierre Cazenave

Move array out of loop as it is constant across iterations.

parent cb39c6ca
...@@ -330,11 +330,11 @@ for ii = 1:numvars ...@@ -330,11 +330,11 @@ for ii = 1:numvars
ss = 0:1 / (nt - 1):1; % scale from 0 to 1. ss = 0:1 / (nt - 1):1; % scale from 0 to 1.
% Use the first modelled time step. % Use the first modelled time step.
startdata = squeeze(data(:, :, 1)); startdata = squeeze(data(:, :, 1));
td = indata.(fnames{vv}) - startdata;
for tt = 1:nt for tt = 1:nt
if tt == 1 if tt == 1
sfvdata(:, :, 1) = startdata; sfvdata(:, :, 1) = startdata;
else else
td = indata.(fnames{vv}) - startdata;
sfvdata(:, :, tt) = startdata + (ss(tt) .* td); sfvdata(:, :, tt) = startdata + (ss(tt) .* td);
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment