how to sort in a loop?
Mostrar comentarios más antiguos
the main question is solved but i have another question.
for i= 1:42
for j=0:100:4100
A(i)=sort(Achsemoment==(j) & Achsemoment<=(j+1));
end
end
i am having a vector of length 100000
which contains values from 0 to 4200
and i want to sort them all in step of 100 in different variables...
so tried this but not getting correct code
4 comentarios
dpb
el 23 de Oct. de 2018
What specifically do you want the result to be???
Shubham Mohan Tatpalliwar
el 24 de Oct. de 2018
Abdul Rehman
el 24 de Oct. de 2018
Editada: Abdul Rehman
el 24 de Oct. de 2018
%Try like this:
if true
k=1;
for i=1:42
for j=1:100
a(i)=sort(Achsemoment(k));
k=k+1;
end
Sort:
Think so it's helpful, thank..!
I want 42 vectors like a1,a2,a3....a42
This is a very bad idea, which is discussed daily in this forum. Please read: Why and how to avoid the dynamic creation of variables.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Shifting and Sorting Matrices 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!