I made a tiny mistake. That is why proper label
for X-axis didn't show up. :-) I now can see proper labels.
======>
Question 1:
As described the above, you assmed a=[-5,-3,1,2,4].
Then without removing the op(-a) as seen in my code,
how could I modify your code to plot -5,-3,1,2,4 only rather than plotting its symmetry values 5,3,-1,-2,-4 ?
======>
Question 2:
when we draw "positive" side plot using "pos", its first point is close to Y-axis.
How can I make proper distance from Y-axis from the first point?
Using "view" option ???
=====>
Question 3:
How can I count paticular numbers?
ie) Let's assume we have the following data
a:=[1, 1, 1, 3, 4, 7, 3.2, -1, -1, 5 1, -1]:
How can I count how many both 1 and -1 has in the array?
I expect to have 7 counts.
=====>
Question 4:
I have a data such as:
a:=[1,2,3,4,1,5,2,2]:
As seen in the array, the number "1" has twice and "2" has three times. What I want is that
(1) Find true or false from the array data.
If any number is duplicated in the array,
it is "true" otherwise "false"
(2) Then find what number is duplicated.
From the above example,
duplicated numbers are "1" and "2".
=====>
Question 5:
I made the following simple expression.
restart:
X:=array(1..12):
for i to 12 do
X[i]:=i:
end do:
print(X);
nops(X);
Its result came out:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
size:=1
How can I print the array size to be 12?
Somehow using the "nops" doesn't give me a correct size.
Let's assume the X is Table and not an array.
In the case, how can I display number of contents in the table?
i.e)
for i to 12 do
X[i]:=i:
end do:
print(X);
nops(X);
Its result:
TABLE([1 = 1, 2 = 2, 3 = 3, 5 = 5, 4 = 4, 7 = 7, 6 = 6, 10 = 10, 11 = 11, 8 = 8, 9 = 9, 12 = 12])
size:=1
** Still give me 1 for table size. I expect 12.
======>
Question 6:
I sorted the "a" array under assumptions and its result came out.
Used code:
a:=[w1+w2-w3,
-w1+2*w2,
2*w1-w2-2*w3,
-w1+w2-w3,
-w1+w2+w3]:
b:=w3>w2,w2>w1,w1>0,w2-w1>w3-w2:
sort(convert(a,list),is @\<\) assuming b;
Sort result becomes:
**2*w1-w2-2*w3**, **-w1+w2-w3**, w1+w2-w3, -w1+2*w2, -w1+w2+w3
If we plot original values (without symmetry values),
points in X-axis perfectly match with the sort result !! :-)
Let's assume we draw the plot in positive side only using your "pos" procedure.
Order of points in X-axis plot now becomes:
w1+w2-w3, **w1-w2+w3**, -w1+2*w2, -w1+w2+w3, **-2*w1+w2+2*w3**
As seen, its order is now different from the result by
previous "sort" function and the negative symbol becomes positive in positive plot.
How can I modify the previous "sort" command to match with the order of positive points and symbols in X-axis plot?
Thanks!