Filter löschen
Filter löschen

For Loop help condensing a matrix

1 Ansicht (letzte 30 Tage)
Julianna
Julianna am 28 Okt. 2020
Kommentiert: David Hill am 28 Okt. 2020
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 Kommentar
David Hill
David Hill am 28 Okt. 2020
What is L? Why is row 40 length = L(1)-1?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by