jquery (hard to overstate how cool that JS library is) has the ability
to do all of that so I looked around and found the following jQuery
plugin http://gregweber.info/projects/uitableedit.html . With a few
tweaks I made it perform as you describe it. I hosted it on my webpage
and with the following code you can call it from any of your
notebooks.
def matrixedit(m=3,n=3,fill=0):
h = m*30 + 100
w = n*30 + 100
print '<html><iframe style="border:0px" height="%(h)s px" width="%
(w)s px" src="http://www.math.uiuc.edu/~rkirov2/matrixedit/index.html?
m=%(m)s&n=%(n)s&fill=%(fill)s"></html>' % locals()
matrixedit()
There is still room for improvement if anybody is interested in
getting their hands dirty with JS (it took me awhile to get the right
tweaks in, and I still dont understand it all).
Rado
On Mar 23, 7:42 pm, Alberto Ferreira <[email protected]> wrote:
> Hi everyone. I have used sage for some time and it was really useful
> in calculus and algebra though I made heavy use of it to deal with
> matrices operations and in my opinion the process of inputting (create/
> edit) matrices could be made faster and less error-prone.
>
> The standard way to input matrices is to do:
>
> m=matrix([[row1:col1,row1:col2,...],[row2:col1,row2:col2,...],...])
>
> This is perfectly fine if you are using small matrices or only using 7
> or 8 of them but if you need to double-check your . calculations and
> have to create a lot of matrices this becomes cumbersome, tiring and
> error-prone. It's easy to forget a comma, etc.
>
> So I suggest that a "gui" matrix editor should be available. You would
> press a button, choose the number of rows and columns and then you
> would just input your values like an excel sheet. After exiting, the
> matrix is dumped from the visual format to the
> [[row1:col1,row1:col2,...],[row2:col1,row2:col2,...],...] format
> directly in the worksheet.
>
> Since we're editing matrices we can make some assumptions to improve
> the workflow: You are always in "edit-mode" so you can type in the
> selected cell or move between cells but only if you press enter does
> the typed phrase get accepted into the selected cell. Also, when you
> press enter, the cursor skips to the next cell. The next cell is
> always to the right of the active one unless we're in the last column
> and in that case we jump to the first cell of the first line.
>
> I have made a small C program for linux (porting to windows is still
> on the way) that does what I'm saying but is not integrated with
> sage:http://sourceforge.net/projects/matrixstudio/
>
> So you launch the program, set the dimensions of the matrix, fill it
> out and press END. Now just press Ctrl+v in sage and the matrix
> appears magically converted (if you have installed xclip).
>
> Best regards, Alberto
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
To unsubscribe from this group, send email to
sage-devel+unsubscribegooglegroups.com or reply to this email with the words
"REMOVE ME" as the subject.