# Symbolic matrices; Subsets; local variables

**URL:** <https://community.wolfram.com/t/symbolic-matrices-subsets-local-variables/1791>\
**Category:** Questions\
**Tags:** mathematica, symbolic-computations\
**Created:** [March 23, 2014, 11:17pm UTC](https://community.wolfram.com/t/symbolic-matrices-subsets-local-variables/1791 "2014-03-23T23:17:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casperyc](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@casperyc](https://community.wolfram.com/u/casperyc)\
**Post date:** [March 23, 2014, 11:17pm UTC](https://community.wolfram.com/t/symbolic-matrices-subsets-local-variables/1791/1 "2014-03-23T23:17:43Z")

</div>

Hi all,

I am a long-time Maple user and I have some questions to ask.  
For my research, I wonder if Mathematica will be more powerful in some aspects.  
I have read some documents and know basic computations.  
I also know how to write basic functions.  
But still have difficulty in the followings:

1 - I want to get all possible lists (sets) of {0,1} given K  
Examples like K=3,4,5  
Note that the set with all 0s are removed.

 ![CH.png](https://global.discourse-cdn.com/wolfram/original/3X/1/0/10226060c8cf25e0b83152fd625e4756266838d9.png)

2 - How to get “Matrix” in Mathematica? I read that they are like “Tables”, but how exactly do I creat them?

 ![ParM.png](https://global.discourse-cdn.com/wolfram/original/3X/c/f/cf438449d2c8c13a8035d6a6534106d35d776c0e.png)

I think I can get the “symbolic” matrix, like this:

```auto
Module[{ans}, 
 ans = Table[
    Subscript[\[Mu], \[Phi]] + Subscript[\[Tau], \[Phi], j] + 
     Subscript[\[Eta], \[Phi], c], {j, 1, 5}, {c, 1, 
     3}] /. {Subscript[\[Tau], \[Phi], 1] -> 0, 
    Subscript[\[Eta], \[Phi], 1] -> 0};
 MatrixForm[ans]]

```

This is fine. But if I have assigned any of the variables, such as Subscript[\, \]=0.4, or any of the variables,  
the output would change. I dont want that to happen.

How do I make ALL the variables in the above matrix “local” to the function?  
Also, how do I ask Mathematica to get a set (list) of all the varibles in the matrix above?  
Like the “indets” function in Maple.

3 - Problem with “MatrixForm”

 ![M11.png](https://global.discourse-cdn.com/wolfram/original/2X/c/ca1e412996e73247a85fe04428264d6d6bd40522.png)

Does " “MatrixForm” actually term the expression into Matrix?  
I would expect the output to give me the entry of 1 row and 1 column, i.e. mu\_phi

4 - In Mathematica, is mu\_phi a valid “symbol” (variable)?  
How do I define it to be a “whole” “symbol” (variable)?

5 - Aside from True,False, how do I get an error message if neither True nor False is given?

 ![TFW.png](https://global.discourse-cdn.com/wolfram/original/3X/e/6/e6f8ab7d643cd5d744c7bf67e509b826351ae87e.png)  
In out39, I would expect a error message.

6 - Another form to say “True”

 ![simple.png](https://global.discourse-cdn.com/wolfram/original/3X/b/f/bff9b21dea099992bb7ef7a1645682cc5744f357.png)

It is possible to have Out45 and Out56 to be the same we have the input “True”?

Thanks!

---

<div class="post-metadata">

**Author:** ![bsimpson141421356](https://avatars.discourse-cdn.com/v4/letter/b/ac91a4/32.png) [@bsimpson141421356](https://community.wolfram.com/u/bsimpson141421356)\
**Post date:** [March 24, 2014, 3:16am UTC](https://community.wolfram.com/t/symbolic-matrices-subsets-local-variables/1791/2 "2014-03-24T03:16:59Z")

</div>

```auto
myCHcc[K_] := Table[IntegerDigits[n, 2, K], {n, 1, 2^K - 1}]

```

[https://reference.wolfram.com/mathematica/ref/If.html](https://reference.wolfram.com/mathematica/ref/If.html)

```auto
In[2]:= Union[Apply[Flatten, tmp /. Plus -> List]]

Out[2]= {Subscript[\[Mu], \[Phi]], Subscript[\[Eta], \[Phi], 2], Subscript[\[Eta], \[Phi], 3],
 Subscript[\[Tau], \[Phi], 2], Subscript[\[Tau], \[Phi], 3], Subscript[\[Tau], \[Phi], 4],
 Subscript[\[Tau], \[Phi], 5]}

```
