3
$\begingroup$

Suppose I have a matrix {{1,2,3},{4,5,6}}. I want to remove the curly brackets near the edges, i.e., I want an output as '{1,2,3},{4,5,6}'. Somebody please help me to solve it.

$\endgroup$
2
  • 1
    $\begingroup$ for display purposes you can use Row: e.g., Row[{{1, 2, 3}, {4, 5, 6}}, ","]. $\endgroup$
    – kglr
    Sep 9, 2019 at 18:31
  • $\begingroup$ Thanks a lot. It works. $\endgroup$
    – atanu
    Sep 9, 2019 at 18:39

1 Answer 1

4
$\begingroup$

For display purposes you can use Row: e.g.,

 Row[{{1, 2, 3}, {4, 5, 6}}, ","]

enter image description here

Update: to get {1,2,3,4,5,6} from {{1, 2, 3}, {4, 5, 6}} use Join:

Join @@ {{1, 2, 3}, {4, 5, 6}}

{1, 2, 3, 4, 5, 6}

$\endgroup$
2
  • $\begingroup$ @atanu, please see the update. $\endgroup$
    – kglr
    Sep 9, 2019 at 18:51
  • $\begingroup$ thanks again. Actually my intention was to use for 'Join' purpose. $\endgroup$
    – atanu
    Sep 9, 2019 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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