필터 지우기
필터 지우기

I have a row of 1308 values and I need the total every 12 rows. So I need the sum of rows 1-12 and then again for the next 12 numbers

조회 수: 2 (최근 30일)
1
1
1
5
5
1
1
1
10
1
1
1
so basically I need the sum of all these numbers in this entire column for the 12 rows and then i need to get the values for the next 12 rows

채택된 답변

chemPolonium
chemPolonium 2020년 2월 10일
Maybe you can use reshape and sum function.
For example:
a = rand(1, 1000); % this create a rand vector of 1000 dims
b = reshape(a, 10, 100); % this convert vector a to a matrix of 10 rows and 100 columns
c = sum(b); % this calculate the sum of each column
  댓글 수: 4

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by