COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### equal column width matrix?

• Email
• Follow

My supervisor would like his matrices to have equal column
width.   That means that a 0 entry would be centred in
enough blank space to make the column width as wide as
the widest entry in the matrix.   This can probably be
hacked by measuring the widest entry and having the
other entries centred in a hbox that wide.  But is there
a more elegant and automatic way to do this?

David

 0

See related articles to this posting

In article <dalton-B09DCC.16593403022011@news.eternal-september.org>,
David Dalton <dalton@nfld.com> wrote:

> My supervisor would like his matrices to have equal column
> width.   That means that a 0 entry would be centred in
> enough blank space to make the column width as wide as
> the widest entry in the matrix.   This can probably be
> hacked by measuring the widest entry and having the
> other entries centred in a hbox that wide.  But is there
> a more elegant and automatic way to do this?

I forgot to mention that we are using the array
environment in LaTeX.

David

 0

Le 04/02/2011 00:05, David Dalton a �crit :
> In article<dalton-B09DCC.16593403022011@news.eternal-september.org>,
>   David Dalton<dalton@nfld.com>  wrote:
>
>> My supervisor would like his matrices to have equal column
>> width.   That means that a 0 entry would be centred in
>> enough blank space to make the column width as wide as
>> the widest entry in the matrix.   This can probably be
>> hacked by measuring the widest entry and having the
>> other entries centred in a hbox that wide.  But is there
>> a more elegant and automatic way to do this?
>
> I forgot to mention that we are using the array
> environment in LaTeX.
>
> David

You can try the tabu package as in:

\documentclass{article}
\usepackage[delarray]{tabu}

\begin{document}\makeatletter
{

$\begin{tabu}spread 1in|{*4{X[$c]}}|
\alpha & \beta & \gamma & \delta \\
\sum_i \frac{a_i}{x_i} & 0 & \cdot & \cdot \\
\end{tabu}$} \end{document}\endinput But it still under development... It's not possible to give standard l, c, r columns a specific width, instead, embed your math content into a paragraph column >{$}m{width}<{$} This is what tabu does, measuring the widths to make them equal: "X[$c]" replaces
">{\centering\arraybackslash}}>{$}p{some dimen}<{$}"

....

 0

2 Replies
256 Views

Similar Articles

12/13/2013 12:46:41 PM
[PageSpeed]

Similar Artilces:

Normalizing matrix (rows AND columns equal to 1)
I'm working on a specific matrix and I need to normalize the sum of the elements in all the rows and all the columns to be equal to 1. I have managed to create the codes to do both separately but does anyone know how to obtain both simultaneously? thank you!!! On 11/21/2012 4:55 PM, zuzia wrote: > I'm working on a specific matrix and I need to normalize the sum of the > elements in all the rows and all the columns to be equal to 1. I have > managed to create the codes to do both separately but does anyone know > how to obtain both simultaneously? > thank you!!! ...

Creating matrix from another matrix using column position
Hello everyone here..... I have problem here, I have a matrix 16x24, lets call it matrix A. There is Matrix B 24x24 which depend on the reading row and column with values from Matrix A. Here are link for matrix A: https://docs.google.com/file/d/0B-dcMNCq0QF8OTdPMS1WRVNxb1k/edit?usp=sharing After that, I want to create matrix C, consist of matrix 150x150. The rule are below here: 1. Matrix C formed from matrix A. 2. Each row and column from matrix C are read the values from matrix A for each row, not the entire matrix. If there is no values from matrix A (based on the tables...

add column matrix to each element of each diagonal in square matrix
A(mxm) square (where m is odd from 3 to 99) E(1xn) (where n is the number of diagonals of A) i need to add each element of E to each element of the corresponding diagonal of A Result is B(mxm) 1st diagonal B(1,1)=A(1,1)+E(1,1); 2nd diagonal B(2,1)=A(2,1)+E(1,2); B(1,2)=A(1,2)+E(1,2); 3rd diagonal B(3,1)=A(3,1)+E(1,3); B(2,2)=A(2,2)+E(1,3); B(1,3)=A(1,3)+E(1,3); and so on ... nth diagonal B(m,m)=A(m,m)+E(1,n); I kind of got stick below. Appreciate help with finishing this or a new solution. For example when m=5; n=9; A=[1 2 3 4 5; 2 3 1 0 0; 1 1 2 3 5; 0 1 2 2 2; 3 3 1 1 1]; E=[1 -...

retrieve actual column widths for a table (or how to prevent columns from resizing)?
I am displaying a table and using javascript to provide an incremental search capability that allows certain rows to be dynamically hidden. The original table specifies no column widths, so I'm relying on the table layout manager to set up the initial columns nicely (which it does). However, when I start hiding rows, the columns automatically change size and this doesn't look nice. I'd like to be able to grab the actual column widths after the page is first displayed and then use those values to force the columns to stay the same size. Is there a way to do this? (Or is there a...

Remove some columns from a matrix
Hello, A=rand (200, 450); I would like to remove these columns (20, 36, 50:60, 71, 89) from 'A' . Should I use following command line to do this function? I wrote 50:60 since I need also to remove columns from 50 to 60. A(:,20&36&50:60&&71&89)=[]; Thanks, Jerry "Jerry " <jerrycholo@gmail.com> wrote in message news:kfipqu$o9t$1@newscl01ah.mathworks.com... > Hello, > > A=rand (200, 450); > > I would like to remove these columns (20, 36, 50:60, 71, 89) from 'A' . > Should I use following command li...

Matrix to Column vector
Could some please give the code to convert a matrix into a column vector.. as in 'vec' operator functions. eg: A=[1 2; 3 4] vec(A)= [1 2 3 4]' Thanks & Regards and also please help me out to convert an array to a vector. DSPtree <paulscot45@yahoo.com> wrote in message <1147924387.366528.1276850904941.JavaMail.root@gallium.mathforum.org>... > Could some please give the code to convert a matrix into a column vector.. as in 'vec' operator functions. > > eg: A=[1 2; 3 4] > > vec(A)= [1 2 3 4]' A(:) Bruno ...

column width #2
In the example below, in "m{0.2in}" I change the value from 0.2 to 0.3 and nothing happens. Why latex does not react? \documentclass{article} \usepackage{xcolor,ragged2e,graphicx, amssymb, amsmath, marvosym, eurosym, setspace, booktabs, colortbl, warpcol, array, textcomp, threeparttable} \begin{document} \begin{figure}[h] \centering \newcolumntype{M}{>{\centering\arraybackslash}m{0.2in}} \begin{tabular}{ m{0.7in} *{11}{ M} } \hline \multicolumn{1}{|l}{Age} & \multicolumn{1}{|c}{62} & \multicolumn{1}{|c}{63} & \multicolumn{1}{|c}{64} ...

Multicols and column width
Hello, How can I place some parts of a document in a 2 (or more) column mode having different column widths ? Thanks in advance Regards, RR On Nov 23, 1:36 pm, RR <r...@mesne.fr> wrote: > How can I place some parts of a document in a 2 (or more) column mode > having different column widths ? Try using minipages: \begin{minipage}[t]{5cm} Column 1 text - this will be a paragraph, aligned to the top [t] of the box. \end{minipage} \hskip 5pt \begin{minipage}[t]{10cm} Column 2 is wider and should have its top aligned to Column 1. \end{minipage} -- Steve Hicks "Ste...

Column width problem
For some reason, the column with the header "p-val" does not end where the cmidrule ends but before it. That is, I want that there is no white space left at the right hand side of the column with the header "p-value". I want that the column ends where ever the cmidrule ends. Or maybe the cmidrule has a problem here. The rule does not end with the column p-value. How can I fix this? \documentclass[a4paper]{article} \usepackage[left=2cm,top=2cm,right=2cm]{geometry} \usepackage{xcolor,ragged2e,graphicx, amssymb, amsmath, marvosym, eurosym, setspace, booktabs, colort...

set width of columns in layoutmanager
Hi, I hope you can help me... How do i change the widths of the columns in my gridlayout? i have a 9x9 grid and i want the outer 8 to be small, the the centre cell large, so i need to set the top and bottom row heights to small, and the left and right column widths to small. How can i achieve this? Thanks!!! :) Anrew Andrew Bullock wrote: > > How do i change the widths of the columns in my gridlayout? > i have a 9x9 grid and i want the outer 8 to be small, the the centre > cell large, so i need to set the top and bottom row heights to small, > and the left and rig...

Glossaries: Specifying column width

removing columns in a matrix with NaN
Hi there, i am working on a matrix with NaN values randomly interspersed in the data. I wanted to delete the entire column containing any NaN value. Is there anyway to do it easy in matlab. thanks. On 11/2/2011 1:17 AM, Irene wrote: > Hi there, i am working on a matrix with NaN values randomly interspersed in the data. > I wanted to delete the entire column containing any NaN value. Is there anyway to do > it easy in matlab. thanks. may be ------------------- EDU>> a=[1 2 3 4; 5 nan 7 8 ; 9 10 11 nan] EDU>> [r c]=find(isnan(a)) EDU>&...

Matrix with crossed-out columns and lines?
Does anybody know how to create a matrix where individual columns or lines are crossed-out by a vertical or horizontal line through them? I already looked at kbordermatrix.sty http://www.hss.caltech.edu/~kcb/LaTeX.shtml Thanks, Markus On 07-04-2006 14:30, Markus H�nchen wrote: > Does anybody know how to create a matrix where individual columns or > lines are crossed-out by a vertical or horizontal line through them? I would use pstricks (+ pst-node), define nodes at each of the points and join them with a connector. Best regards, Jose Carlos Santos On 2006-04-07 16:09:08 +02...

reorder matrix elements in columns
Hi all, I need some help to optimize a code. If I have an original matrix (test_input), and the order of the elements in each column (test_order). For example, test_input = 81 10 16 91 28 97 13 55 96 91 96 49 63 96 80 test_order = 5 2 5 2 1 4 1 3 1 3 4 3 4 5 2 I want to rearrange the elements in each column of 'test_input' according to the order in the 'test_order', so the output that I am looking for is test_output = 63 28 80 91 10 49 81 55 16 13 96 96 91 96 97 I tried 'test_input(test_order)...

Problem Setting Column Widths
Hi All, I'm attempting to set the width of some columns in a JTable to the size of their column header's plus the column margin. I call the following method for each column in the table. I don't want some columns to have a fixed size hence the boolean. private void setColumnWidth(JTable jTableIn, int intIn, boolean booleanIn) { String value = jTableIn.getColumnName(intIn); JTableHeader jHeader = jTableIn.getTableHeader(); FontMetrics metrics = jTableIn.getGraphics().getFontMetrics(jHeader.getFont()); int width = metrics.stringWidth(value) + (2 * jHeader.getColum...