How can i write x ∈ A

5 次查看(过去 30 天)
Triveni
Triveni 2015-12-19
B = [30 60 30 60 60 30];
[No,Th] = hist(B,unique(B));
A = Th;
i want to right in other program
x ∈ A
  5 个评论
John D'Errico
John D'Errico 2015-12-19
Yes. We know what set membership means in mathematics. But what you are not telling us is what you want to do. Explain yourself clearly.
Triveni
Triveni 2015-12-19
Actually i have to create bound in Genetic Algorithm Optimization....I need only values of subset of A. My B matrix is changing B(:,:,k). And by using unique values of B, create x matrix.

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2015-12-19
编辑:Walter Roberson 2015-12-19
for x = reshape(A,1,[])
... do something ...
end
  1 个评论
Walter Roberson
Walter Roberson 2015-12-19
unique(x) gives the elements of X. In the context you give in your comment, the values are going to be the same as 1 : length(unique(B))

请先登录,再进行评论。

类别

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

标签

尚未输入任何标签。

产品

Community Treasure Hunt

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

Start Hunting!

Translated by