필터 지우기
필터 지우기

Hi , can anyone help me to do this , thank you

조회 수: 2 (최근 30일)
mina massoud
mina massoud 2019년 5월 11일
답변: madhan ravi 2019년 5월 11일
% i have a matrix 4x32 , and i need to sum the element to obtain a matrix 4x4
clear all
clc
A= randn(4,32) ;
% (1 5 9 13 17 21 25 29) i need to take this colum and sum in row ( sum,2) so i obtain a matrix 4x1
%(2 6 10 14 18 22 26 30) i need to take this colum and sum in row ( sum,2) so i obtain a matrix 4x1
%(3 7 11 15 19 23 27 31) i need to take this colum and sum in row ( sum,2) so i obtain a matrix 4x1
%(4 8 12 16 20 24 28 32) i need to take this colum and sum in row ( sum,2) so i obtain a matrix 4x1
%to obtain at the end a matrix 4x4
% thank you

채택된 답변

madhan ravi
madhan ravi 2019년 5월 11일
Z=permute(reshape(A.',8,4,[]),[2,1,3]);
Wanted = reshape(sum(Z,2),4,[])

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by