Analyzing different sections of an array

1 回表示 (過去 30 日間)
L'O.G.
L'O.G. 2022 年 11 月 27 日
回答済み: Jan 2022 年 11 月 27 日
How do you analyze the first 10 columns of an array (all rows) and columns 11-20, 21-30, and so on, separately?

採用された回答

Jan
Jan 2022 年 11 月 27 日
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 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by