필터 지우기
필터 지우기

For Loop help condensing a matrix

조회 수: 1 (최근 30일)
Julianna
Julianna 2020년 10월 28일
댓글: David Hill 2020년 10월 28일
Hello.
I created a large array called Hist that is (160x6) with my number of iterations over the length is in the 1st column. When a variable nSpans is equal to 4, I would be trying to pull out four specific lengths: L(1) - 1, L(2) - 1, L(3) - 1, and L(4) - 1, and what each other column is equal to in the rows that these occur.
Example, row 40 is where L(1) - 1 occurs and is shown below:
10.0000 2 -11.0714 -10.7143 0.2375 0.0030
How would I write a for loop for n=1:nSpans to do this? I basically just want to condense my Hist matrix to be (nSpans,6).
Let my know if anyone needs more information. Cheers.
  댓글 수: 1
David Hill
David Hill 2020년 10월 28일
What is L? Why is row 40 length = L(1)-1?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by