How can i write x ∈ A

7 vues (au cours des 30 derniers jours)
Triveni
Triveni le 19 Déc 2015
Commenté : Walter Roberson le 19 Déc 2015
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 commentaires
John D'Errico
John D'Errico le 19 Déc 2015
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 le 19 Déc 2015
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.

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 19 Déc 2015
Modifié(e) : Walter Roberson le 19 Déc 2015
for x = reshape(A,1,[])
... do something ...
end
  1 commentaire
Walter Roberson
Walter Roberson le 19 Déc 2015
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))

Connectez-vous pour commenter.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by