Here's a question that pertains to UI design, but for an application geared at a more technical audience.

In my application, users can assign an object properties of several types. These types include various numerical types and vectors/matrices thereof.

If a property is divisible, then you can expand it and modify the individual pieces in a tree-like structure.

You can expand those four vector fields even further to modify the components, or just edit the field directly and separate the numbers by commas. Notice how there's no equivalent for the matrix property itself, though. How can I summarize--and ideally, allow the user to easily modify--the contents of a matrix in a single text field? Note that the width and height of these matrices can be between 2 and 4, inclusive.

3 Answers 3


MATLAB uses commas to delimit columns and semicolons to delimit rows. Thus, a matrix can be displayed and edited in a single string using a combination of these delimiters.

String Format:

[1,2,3; 4,5,6; 7,8,9]

Matrix Format:

1 2 3
4 5 6
7 8 9
  • Beautifully simple, I don't know why I'd never thought of it. Thanks!
    – JesseTG
    Apr 21, 2016 at 17:31

You could just give the user a formatting syntax for defining the matrix, so it can be entered as plain text.

It would probably help if you use a multi-line re-sizable text field, then you can have one vector per line, and just have space separated values. You can even format the values with extra spaces between them so that the user can clearly see columns in their text field.

For example, the user would enter something like this:

 3.3805 -0.005050505 -34.6544
 2.3  0.4 -0.003
 456.123 0.1 0.23333

..and then the values would be formatted like this once they were saved (making it easier to read and edit):

   3.3805 -0.005050505 -34.6544
   2.3     0.4          -0.003
 456.123   0.1           0.23333

You could use a text area that opens immediately below the 'col1 [-0.012526, 2.4....], which can show you the numbers separated by commas. Not only does this allow you to see more items per view, it is as easy as you would edit in a single text input box. Using text area enables you to contain more content and useful when at times you want to see more items at once, for example to compare relatively.

  • This is pretty much already what I'm doing, unless there's something about your suggestion I'm missing.
    – JesseTG
    Apr 3, 2016 at 1:47

Your Answer

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

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