Borrar filtros
Borrar filtros

how to sort dlarrays

8 visualizaciones (últimos 30 días)
feynman feynman
feynman feynman el 4 de Dic. de 2022
Respondida: Aritra el 20 de Mzo. de 2023
How to sort dlarrays like in
, where a is a numeric array? Is there a way of sorting next(mbq) by specifying some options in the following code?
mbq = minibatchqueue(ads,MiniBatchSize=miniBatchSize,MiniBatchFormat="BC");

Respuesta aceptada

Aritra el 20 de Mzo. de 2023
As per my understanding you are trying to sort a "dlarray" using the "sort" function.
A "dlarray" is a deep learning array designed to store data with optional data format labels for custom training loops. It also enables functions to compute and use derivatives through automatic differentiation.
However, to sort a "dlarray" you must initially convert it to a double array using the "extractdata" function. You can then use the "sort" function to sort the double array. The following code describes the same:
X = randn(1,5);
dlX = dlarray(X);
t = extractdata(dlX);
For detail, please see this MathWorks documentation below for more information on sorting multi-dimensional arrays:

Más respuestas (0)


Community Treasure Hunt

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

Start Hunting!

Translated by