Analyzing different sections of an array

How do you analyze the first 10 columns of an array (all rows) and columns 11-20, 21-30, and so on, separately?

 采纳的回答

Either reshape the array:
x = rand(20, 100);
y = reshape(x, 20, 10, 10);
m = mean(x, 2); % If you want the mean value over block of 10 columns
or use a loop:
for k = 1:10:100
a = k;
b = k + 9;
process(x(:, a:b));
end

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Logical 的更多信息

产品

版本

R2021b

标签

提问:

2022-11-27

回答:

Jan
2022-11-27

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by