Compiling resampled data arrays using For loop
显示 更早的评论
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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!