Compiling resampled data arrays using For loop
Show older comments
I have six 20x1 cell arrays each containing a remote sensing variable resampled at 20 levels of resolution. I want to merge the six cells into a single cell array, by resolution. Thus, the output would be a cell containing twenty M x N x 6 arrays, where m and n are the same dims within each array.
There is a problem (or two) with how I am parsing outputs in my nested for loop. Thoughts?
vars = {'Cs' 'beta' 'As' 'TCI' 'TWI' 'hs'}
tmp = cell(size(dem)) % create supercell, one array per level of res
out = tmp;
tmp2 = size(vars) % create 6x1 subcells one array per variable
out2 = zeros(tmp2);
for i=1:numel(dem)
for j=1:numel(vars)
out{i} = out2(:,:,j)(Cs{i}, beta{i}, As{i}, TCI{i}, TWI{i}, hs{i});
end
end
Error: ()-indexing must appear last in an index expression.
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!