フィルターのクリア

How to do summation columnwise and create the structure array of summed values.

1 回表示 (過去 30 日間)
AS
AS 2022 年 6 月 6 日
回答済み: KSSV 2022 年 6 月 6 日
I have matrix with dimension 1125 * 1128. I want to do summation of every 141 columns and so on. Then store the output in data structure array. Like that there will 8 suumed out in structure array.

回答 (1 件)

KSSV
KSSV 2022 年 6 月 6 日
You can achieve it by using reshape and sum.
First, reshape your matrix into a 3D matrix and then apply/ do what you want.
R = 1125; % Number of rows
C = 1128; % Number of columns
newC = 141; % New number of rows
A = randi(10, [R C]); % 1125x1128 array of random integers
B = reshape(A, [R newC C/newC]);
In the above, you can do what you want in the matrix B.

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by