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 Kommentare

John D'Errico
John D'Errico am 19 Dez. 2015
But we can have no idea what you intend by that thing you wish to write. It has no meaning, even in mathematics, in context of what you have given us so far, since x does not exist that we have seen. Do you wish to create a variable x with some property? Then tell us. Explain what x must be.
Triveni
Triveni am 19 Dez. 2015
x is subset of A...means unique variable in x contain only matrix of A.
Steven Lord
Steven Lord am 19 Dez. 2015
Do you want to answer the question "Does the variable x contain a subset of A?"
Do you want to generate a random subset of A and store it in x?
Do you want to iterate over ALL subsets of A (which could be a large number of iterates)?
Do you want to do something else (and if so, describe in detail what you want to do)?
John D'Errico
John D'Errico am 19 Dez. 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 am 19 Dez. 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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 19 Dez. 2015
Bearbeitet: Walter Roberson am 19 Dez. 2015

0 Stimmen

for x = reshape(A,1,[])
... do something ...
end

1 Kommentar

Walter Roberson
Walter Roberson am 19 Dez. 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))

Melden Sie sich an, um zu kommentieren.

Produkte

Tags

Noch keine Tags eingegeben.

Gefragt:

am 19 Dez. 2015

Kommentiert:

am 19 Dez. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by