フィルターのクリア

How to group elements of an array?

2 ビュー (過去 30 日間)
parslee
parslee 2022 年 3 月 9 日
回答済み: KSSV 2022 年 3 月 9 日
I have an array of 1x4096 and I would like to group 1-32 cells, 33-64 cells and so on and store them as A1, A2, etc.
I tried writing a for loop
s = linspace(0,127,128);
for i = s
A_i+1 = A(:,32i+1:1:32(i+1));
end
but I'm getting an error that says, "Incorrect use of '=' operator. Assign a value to a variable using '=' and compare values for equality using '=='."
Any simpler method or correction to the for loop would be very much appreciated!

採用された回答

KSSV
KSSV 2022 年 3 月 9 日
REad about reshape.
A = rand(1,4096);
B = reshape(A,[],32) ;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by