Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.
  ({{a, b}, {c, d}})

a, b, c and d are Lists of 300 length. Their first 4 elements must specify their position in the column (1 column, 2 column, etc) and the following 4 elements the position in the line (1 line, 2 line, etc) but this must be made in binary code and not a 2x2 Table but a 10x10. Also, they must only contain -1, 0 or 1.

I was thinking about creating the vector with a smaller length and use AppendTo to put the position based on the table index and converting it to binary but couldn't find a final solution.

share|improve this question
    
That had something wrong in it. Sorry. Is it better to understand now? Or still confusing? –  André F. Jun 18 at 23:29
1  
Let me try and paraphrase this, tell me if I'm correct: You want a 10X10 matrix. Each entry is a 300 length vector, first 4 elements represent the second dimension position in binary, second 4 elements the first dimension, and the rest of the list is randomly (based on post before edits) selected elements from {-1,0,1}. Is that it? –  rasher Jun 18 at 23:43

1 Answer 1

This does what you're after, I believe (see my comment question) - if not, I'll delete this answer:

result=Partition[Join @@@ Transpose[{Join @@@ Reverse /@ Tuples[IntegerDigits[Range@10, 2, 4], {2}], 
       RandomChoice[{-1, 0, 1}, {100, 292}]}], 10]
share|improve this answer
    
Your comment says exactly what I'm after for. Sorry for my bad English on explanation. It this code do that than is exactly what I want –  André F. Jun 18 at 23:49
    
@AndréF.: try it, tell me if it's what you intended... –  rasher Jun 18 at 23:49
    
I can't check all results but from what I could see that's exactly it. Thank you @rasher –  André F. Jun 18 at 23:53
1  
@AndréF.: Cool. Glad to help. –  rasher Jun 18 at 23:53
1  
@AndréF.: Do you mean as an actual array? Just use result[[i,j]] or result[[i]][[j]] (note double brackets - that is correct array part specification syntax) –  rasher Jun 19 at 0:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.