Split increasing vector into n unqueal parts based on multiples of n
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Konvictus177
el 18 de Sept. de 2023
Respondida: Stephen23
el 18 de Sept. de 2023
Hi,
I have a vector which consists of increasing numbers.
I want to split the vector into 54 parts based on multiples of 2030. So first vector should contain all numbers from 0 until 2030. Second vector should contain all numbers from 2030 and up until 2*2030 (4060), third vector everything from 4060 up until 3*2030 (6090), etc.
Vector is attached.
Thanks.
1 comentario
Dyuman Joshi
el 18 de Sept. de 2023
load('Denc.mat')
m=max(Denc)
m/2030
You want to ignore the 55th, 56th and the 57th parts?
Also, just to confirm, you want to include the boundary values on both sides?
Respuesta aceptada
Stephen23
el 18 de Sept. de 2023
S = load('Denc.mat');
D = S.Denc
B = 0:2300:2300+max(D)
X = discretize(D,B);
C = accumarray(X,D,[],@(a){a})
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with MATLAB 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!