sorting the values of a vector into a new one by its elements size
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Jan Lettner
el 29 de Nov. de 2018
Comentada: Jan Lettner
el 5 de Dic. de 2018
Hey all
I made some measurements. Between these values, I interpolated. Now, I want to merge both vectors into one but withouth changing the order. Just copy in the new interpolated values into the intervalls of the measured values.
Is there a predefined function from matlab or do I have to write it myself?
Thanks in advance
2 comentarios
Respuesta aceptada
Luna
el 29 de Nov. de 2018
Try this,
xnew = sort(horzcat(y,x)) % concatane vectors then sort all
%% OR
xnew = horzcat(sort(y),sort(x)) % sort x, sort y seperately then concatanate
3 comentarios
Más respuestas (1)
madhan ravi
el 29 de Nov. de 2018
Editada: madhan ravi
el 29 de Nov. de 2018
Simple and easy solution:
xnew=sort([x y])
0 comentarios
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!