Is it possible to use recursive cell formulas in org-mode tables?

旧街凉风 提交于 2019-12-25 05:05:41

问题


I'd like to build a column that begins with a constant, say, 1, and whose succeeding rows are double the preceding row (or some variable coefficient I set in the formula):

| 1  |
| 2  |
| 4  |
| 8  |
| 16 |

Is there a way to quickly set this up in Emacs? I see that there are row formulas, column formulas, and rectangular region formulas, but I don't see any recursion or quick formula replication in the manual.


回答1:


#+TBLFM: @1$1=1::@<<..>$1=@-1 * 2

will produce that table recursively. Put the cursor on the last row and hit C-u C-u C-c * @<<..> is a range from second to the last row.

#+TBLFM: @1$1=0::@2$1=1::@<<<..>$1=@-1 + @-2

will produce the Fibonacci Sequence



来源:https://stackoverflow.com/questions/20063690/is-it-possible-to-use-recursive-cell-formulas-in-org-mode-tables

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!