Remove duplicate values in matrix

74 次查看(过去 30 天)
Hi, I have following code:
a_x = 1.5:0.2:a_max;
a_y = 1.5:0.2:a_max;
a = zeros(length(a_x),length(a_y));
for i = 1:length(a_x)
for j = 1:length(a_y)
a(j,i) = (a_x(i)+a_y(j))/2;
end
end
I would like to remove all duplicate values in a, and turn this in a vector with ascending value. Any idea how?

采纳的回答

KL
KL 2017-10-5
编辑:KL 2017-10-5
unique(a) %EDITED
  3 个评论
KL
KL 2017-10-5
Ah, Thanks Guillaume . Edited!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by