| Author |
Comment/Response |
Yesenia Nunez
|
07/19/00 07:31am
Hi! I am working in a program which uses different values of density fo a specific
range in the x-axis. I using the function ''Which'' to assign the respective
values for each x-range.
I got the array that I wanted but there are some values that are repeated. Now I
want to work in such a way that I can compare them and only get the values which
are not repeated from this array.
For example I have:
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
Clear[den]
den = Table[Which[h[[i]] >= 0.0 && h[[i]] <= 4.0, density[i] = 0.5,
h[[i]] > 4.0 && h[[i]] <= 10.0, density[i] = 1.0,
h[[i]] > 10.0 && h[[i]] <= 15.0,
density[i] = 1.5, True, 2.0], {i, 1, R2}]
This is the array for each density values:
{0.5, 0.5, 0.5, 0.5, 1., 1., 1., 1., 1., 1.}
Now I want the same array but in this way: {0.5,1.} because they are repeated.
URL: , |
|