Re: [O] Insert calc vector directly into spreadsheet cells?

2014-05-27 Thread Steven Adrian
Michael, This is great. I wish I had seen this earlier. I did not know about the subscr function, but I had basically gotten to the same point by writing an equivalent custom calc function. I understand that using a calc function in a table formula is inefficient, since it is executed for

Re: [O] Insert calc vector directly into spreadsheet cells?

2014-05-27 Thread Steven Adrian
Michael, Here is the custom calc function that is similar to subscr. It will work for both vectors and matrices: (defmath getElem (indices m) (let (i j) (if (vectorp indices) (progn (setq i (cadr indices)) (setq j (nth 2 indices)) (nth j (nth i m)) )

Re: [O] Insert calc vector directly into spreadsheet cells?

2014-05-27 Thread Michael Brand
Hi Steven On Tue, May 27, 2014 at 11:12 AM, Steven Adrian sadr...@acumeniacal.com wrote: Here is the custom calc function that is similar to subscr. It will work for both vectors and matrices: (defmath getElem (indices m) (let (i j) (if (vectorp indices) (progn (setq i

Re: [O] Insert calc vector directly into spreadsheet cells?

2014-05-26 Thread Michael Brand
Hi Steven On Mon, May 26, 2014 at 9:39 PM, Steven Adrian sadr...@acumeniacal.com wrote: This is great. I wish I had seen this earlier. I did not know about the subscr function, but I had basically gotten to the same point by writing an equivalent custom calc function. With the Calc function

Re: [O] Insert calc vector directly into spreadsheet cells?

2014-05-21 Thread Michael Brand
Hi Steven Steven Adrian sadr...@acumeniacal.com writes: #+TBLFM: @1$1..@1$10=index(10) But the formula above just puts the whole vector in each cell. Can anyone tell me how to put the vector values in individual cells? The vector elements can be accessed with Calc subscr() and Org field

Re: [O] Insert calc vector directly into spreadsheet cells?

2014-05-20 Thread Bastien
Hi Steven, Steven Adrian sadr...@acumeniacal.com writes: #+TBLFM: @1$1..@1$10=index(10) Table formulas apply to individual fields, not to a range of fields. But the formula above just puts the whole vector in each cell. Can anyone tell me how to put the vector values in individual cells?

[O] Insert calc vector directly into spreadsheet cells?

2014-05-17 Thread Steven Adrian
I would like to insert a calc vector directly into a range of spreadsheet cells from a function. As a specific example, consider the calc index function, which returns a calc vector of integers from 1 to n. Once calc has started within an emacs session, the index function can be accessed from