Use the second return value of sort to reorder your e array.
[d, order] = sort(d); e = e(order);
本文介绍了一种使用MATLAB中的sort函数来重新排列数组的方法。通过获取sort函数的第二个返回值,可以得到原始元素的位置索引,进而实现对另一个数组的相应元素进行相同的排序。
Use the second return value of sort to reorder your e array.
[d, order] = sort(d); e = e(order);

被折叠的 条评论
为什么被折叠?