How to arrange a column vector into two columns?
Mostrar comentarios más antiguos
So, I have this vector and I need to arrange it as loops. Each value for each loop should start as the next integer from the previous ending loop x= [128 147 166 181 195 216 236 255]
It should look something like this x= [128 147; 148 166; 167 181; 182 195; 196 216; 217 236; 237 255]
I cannot do it manually, since I have to arrange several vectors that will not have the same length as this one. I tried using nested for loops but wasn't successful
4 comentarios
Stephen23
el 4 de Feb. de 2022
@David Silva: why do you ignore the second-to-last value (236) when creating the output matrix?
KSSV
el 4 de Feb. de 2022
May be becuase, it falls in the intervel [217 255].
Stephen23
el 4 de Feb. de 2022
"May be becuase, it falls in the intervel [217 255]."
Every (non-end) element in that vector falls in the interval formed by its adjacent elements. What is so special about 236?
Heirleking
el 4 de Feb. de 2022
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!