Conditional addition of matrix rows?

조회 수: 1 (최근 30일)
Andi
Andi 2021년 12월 1일
답변: Walter Roberson 2021년 12월 1일
My data matrix consists of 54 coloumns and 186 rows. The values in the first column varies from 0 to 6. I need to add the rows of remaining columns conditionally.
For example, I set a window of 1 for addition of rows 6-5, 5-4, 4-3, 3-2 and so on.
for first window (6-5), there is only one row ...
for second window (5-4) ... there is two rows for addition ..
for third window (4-3) .. there are 5 rows
clear all
clc
X = readmatrix('NEW.csv'); % data is also attached here

답변 (1개)

Walter Roberson
Walter Roberson 2021년 12월 1일

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by