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?

 채택된 답변

Jan
Jan 2022년 11월 27일

0 개 추천

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