Items tagged with list list Tagged Items Feed

Hi,

I have this out put, let me put it simply as a  single variable(call it A) having multiple outputs such that when i print(A) I get         a
                           b
                           c
                           d
How do i put all the values in a single list to get [a,b,c,d]?

This is what I did: aa:=[]: for i in A do aa:=[op(aa),i]:od:
The output is [a]
                    [b]
                    [c]
                    [d]

How do I get [a,b,c,d] without doing a lot of op???

Thanks,
Vic

Hi,

I have this 5 by 2 matrix, and I want to form  lists of lengths 5, whereby the ith entry in my list should be any of the elements from the ith row of the matrix. How do i get all the possible lists? (I am expecting a total of 32lists, each of length 5):

Hi

First question is, given a list of some positive integers, how can I normalize this list? Normalize here is in the sense that, for example, if 

L := [1,3,4,4,5,7,7,7,8]

then there really are only 6 different integers appear, so I would like to assign each part an integer from 1 to 6 in ascending order. So 1 becomes 1, 3 becomes 2, 4 becomes 3, 5 becomes 4, 7 becomes 5 and so on. Normalized list will be

NormalizedL := [1,2,3,3,4,5,5,5,6]

 

Second question is given a list, let's say [1,3,1,3,2,2,4,4], how can I normalize it in a similar way but now we assign each integer upon occurrence of a part. So [1,3,1,3,2,2,4,4] will be [1,2,1,2,3,3,4,4]. This is necessary for me because lists have repeating parts. 

Another example will be [2,4,4,1,2,2,3,3] will be [1,2,2,3,1,1,4,4]. 

Thank you 

Dear Community,

How could I specify a list of random colors using some kind of an RGB function, which then could be used in another command for coloring? I think of something like this:

myColors := [ seq( RGB ( [rint(0,255) , rint(0,255) , rint(0,255)] ) , j = 1 .. 20 ) ] :

which does not work of course :-)  This should produce me a list of 20 random colors.  What would be the right RGB color function?

Tx for the kind help in advance

best regards

Andras

I have the following command.

with(StringTools);
message := `Kajian ini mempunyai tiga objektif pertama seperti yang ditunjukkan dalam bahagian 1.11. Objektif tersebut harus`;

m := convert(message, bytes);

block := map(convert, m, binary);
block := map2(nprintf, "%08d", block);
block := map(proc (t) options operator, arrow; [seq(parse(convert(t, string)[i]), i = 1 .. length(convert(t, string)))] end proc, block);

block := [[0, 1, 0, 0, 1, 0, 1, 1], [0, 1, 1, 0, 0, 0, 0, 1], [0, 1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 0, 1, 0, 0, 1], ........]

with(Bits);
for i to l do
for j from 3 to 7 do
block[i][j] := 1-block[i][j];  //used to flip bit in between 3rd to 7th bit in a block
end do;
c_block[i] := block[i];
end do;
c_block1 := [seq(c_block[i], i = 1 .. l)];

Error, assigning to a long list, please use Arrays

May i know how to solve this problem? I need to change some bit in a list but receive error when there is more than 100 elements in a list. Thank you.

I have a long list of two element lists, for example,

A := [ [2,3], [4,5] ,[6,7]];

I want apply '/' to the elements of each sublist.

The result will be

R := [2/3, 4/5, 6/7];

I do not need the list, I could use vectors or matrices.

Is it possible to do this other than by iteration?

Tom Dean

How to reverse the order in a list?

example:

i have m := [1, 1, 0, 0, 1, 1, 1, 0]

I want to get the output like newm:=[0,1,1,1,0,0,1,1].

How to solve? Any command can help?

If L is a list [a,c,b,d,f,e]

S is a list [b,c,f,e]

I want to use the permutation opf S to rearrange L [b,c,f,e,a,d]

In my case a,b,c,d,e,f are equations.

Does anyone know how to do crossover between block of binary number?

Example :

If I have 4 blocks, [0011001],[0011100], [0101010], and [1001110].

the first block will crossover with the second block, the second block will crossover with the third block, the third block will crossover with the last block and the last block must crossover with the first block. 

I had tried the code as below. 

for i from 1 to 4 do

for j from 1 to 7 do

block[i][j]:=block[i+1][j];

end do;

new_block[i]:=block[i];

end do;

The problem is the crossover can be done from 1 with 2, 2 with 3 and 3 with 4. But this code unwork for crossover for last block with the first block. Can someone help me? thank you in advance.

Dear Maple users

I wanted to use the zip-command to muliply two lists with units. It works without units, but not with units:

 

 

If I add units to each entrance it works too, but not very convenient. How is it done with units in the best way?

 

Regards,

Erik

>nombor1:=[4,6,2];

nombor1:=[4,6,2]

 

Hi, anyone know hot i need to continue my command to get 462 from [4,6,2]?

Thank you~=]]

>mylist:=468;

mylist:=468

 

Hi, how i need to continue my command to get [4,6,8] from 468?

Thank you~=]]

>teksbiasa:=`Kriptografi`;

teksbiasa:=Kriptografi

>nilaiASCI:=convert(teksbiasa,bytes);

nilaiASCII:=[75,114,105,112,116,111,103,114,97,102,105]

>kekuncirahsia:=3;

kekuncirahsia:=3

 

Hi, anyone know how i need to continue my command to add in kekuncirahsia(3) into nilaiASCII?
What i want to get>>[78,117,108,115,119,115,106,117,100,105,108]

Thank you, Have a nice day~=]]

Here is my command

 

> teksbiasa:=`Kriptografi`;

teksbiasa:=Kriptografi

>len:=length(teksbiasa);

len:=11

>nilaiASCII:=convert(teksbiasa, bytes);

nilaiASCII:=[75,114,105,112,116,111,103,114,97,102,105]

>L:=[seq(i,i=nilaiASCII)]

L:=[75,114,105,112,116,111,103,114,97,102,105]

 

Anyone know how i need to write the command to add the lenght of the text (len) into each of the number in nilaiASCII?

What is want to get is:

[86,125,116,123,127,122,114,125,108,113,116]

Thank you~=]]

[75,114,105,112,116,111,103,114,97,102,105]

Is there a way in Maple to convert a list into a string of numbers?

So [1,2,3,4,5] -> 12345

I have tried Maple help, but there are too many convert commands to try them all.
And the ones I have tried didn't work.

Thanks.

1 2 3 4 Page 1 of 4