Borrar filtros
Borrar filtros

For Loop help condensing a matrix

1 visualización (últimos 30 días)
Julianna
Julianna el 28 de Oct. de 2020
Comentada: David Hill el 28 de Oct. de 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 comentario
David Hill
David Hill el 28 de Oct. de 2020
What is L? Why is row 40 length = L(1)-1?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by