问题标签 [octave]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
3226 浏览

math - 使用 octave/matlab ODE 求解器时拟合 ODE 的参数

我在 Octave 中使用 OdePkg 来解决僵硬的 ODE 系统,例如通过 ode5r:

求解器将因变量 Y 存储在关于时间 t(向量)的矩阵中:

我想在 param 中拟合参数,以便生成的变量 Y 最适合我的参考值,例如:

哪个 Octave/Matlab(欢迎使用其他语言)例程可以执行多参数(最小二乘/样条)拟合?如何在拟合中组合不同初始值Y0 的参数集?如果你能给我一些提示和可能性,我会很高兴。

最好的问候,西蒙

0 投票
6 回答
12542 浏览

excel - 将 Excel 文件中的数据加载到 R 或 Octave 中

我有一个包含大量数据的 Excel 文件。Excel 中可用的内置图表不足以分析这些数据,所以我正在考虑使用诸如 octave 或 R 之类的工具。

我正在考虑一些将 Excel 文件直接加载到 octave 或 R 中的方法。我在网上搜索,发现很多人通过将 Excel 中的数据导出到 CSV 文件中成功使用。

问题:有没有直接的方法在 R 或 Octave 中加载 Excel 文件?

0 投票
6 回答
6883 浏览

r - Finding a curve to match data

I'm looking for a non-linear curve fitting routine (probably most likely to be found in R or Python, but I'm open to other languages) which would take x,y data and fit a curve to it.

I should be able to specify as a string the type of expression I want to fit.

Examples:

What I would get out of this is at least the values for the constants (A, B, C, etc.) And hopefully stats about the fitness of the match.

There are commercial programs to do this, but I expected to be able to find something as common as fitting to a desired expression in a language library nowadays. I suspect SciPy's optimization stuff might be able to do this, but I can't see that it lets me define an equation. Likewise, I can't seem to find exactly what I want in R.

Is what I'm looking for out there, or do I need to roll my own? I hate to do it if it's there and I'm just having trouble finding it.


Edit: I want to do this for a bit more control over the process than I get from LAB Fit. The LAB Fit UI is dreadful. I'd also like to be able to break the range into multiple pieces and have different curves represent the different pieces of the range. In the end, the result has to be able to (speed-wise) beat a LUT with linear interpolation or I'm not interested.

In my current set of problems, I have trig functions or exp() and I need to execute them 352,800 times per second in real time (and use only a fraction of the CPU). So I plot the curve and use the data to drive the curve fitter to get less expensive approximations. In the old days, LUTs were almost always the solution, but nowadays skipping the memory lookups and doing an approximation is sometimes faster.

0 投票
5 回答
13223 浏览

emacs - 如何在 GNU Emacs 中安装 MATLAB 模式?

MATLAB 和/或 Octave 文件是否有 Emacs 主要模式?对于那些不知道的人,MATLAB 文件通常具有“.m”文件扩展名。

我的主要兴趣是 GNU Emacs,但 XEmacs 技巧也将不胜感激。

0 投票
4 回答
9591 浏览

macos - Octave + GNUPlot + Aquaterm + Mac OS 10.6

我正在尝试在 Octave 中完成所有基于 MatLab 的家庭作业 - MatLab 的开源表示。

但是,我在绘制图表时遇到问题,我认为这是一个简单的链接问题。我正在运行:-Mac OS X Snow Leopard (10.6) -Octave 3.2.2 -Aquaterm 1.0.1 -GNUPlot 4.0

这是我从 shell 中得到的错误示例:

我没有解决此问题所需的 unix 基础。有什么建议/修复吗?

0 投票
1 回答
2366 浏览

iphone - 为 iPhone 编译外部 C++ 库(Octave)(缺少 Fortran 编译器?)

我的一个朋友问我是否可以将Octave项目移植到 iPhone。我之前没有为 iPhone 项目编译过外部包,所以我下载了源代码,然后使用在几个不同的网站()上找到的一些脚本来尝试构建库。但是,当我尝试这些脚本中的任何一个(几乎相同)时,它们最终会在该configure阶段死亡,并出现以下错误输出:

是 iPhone SDK/Xcode 不包含 Fortran 交叉编译器的问题,还是我做错了什么?

0 投票
1 回答
1915 浏览

matlab - 有没有办法让 imshow in octave 表现得更像 Matlab?

我目前正在将以前在 Matlab 中所做的一些计算机视觉工作迁移到 Octave。在大多数情况下,这是一个平稳的过渡,除了一个烦恼。

我经常使用 imshow() 过程来查看图像。在我进入 Matlab 的查看器中,我能够检查单个像素以查看它们的值。例如,如果我正在查看带有连接组件标签的图像,我可以单击一个 blob 并查看其中像素的实际值。

不幸的是,我还没有找到在 Octave 中执行此操作的方法。我得到一个查看窗口,但它似乎没有任何检查单个像素的能力。有谁知道如何在 Octave 中模拟这种行为?谢谢。

0 投票
2 回答
2470 浏览

drawing - Gnu Octave 是否有任何现有的用于绘制线或多边形的代码?

背景:

我希望能够采用二维矩阵(实际上是图像)和一组定义多边形的点,并将该多边形绘制到矩阵中。

在我跑掉并重新发明轮子之前,我想我会问是否有人知道 Octave 中任何现有的库或代码可以做到这一点。到目前为止,我在 Octave 包和谷歌上的搜索都是空的。

失败了,两者都不太难实现,但我不确定如何绘制填充多边形。有没有一种简单/有效的方法来判断哪些点在多边形内,哪些在外面?谢谢。

编辑:

我的目的不是显示任何东西。实际上,我特别关注的是一些图像处理的东西,比如绘制一个凸包,找到它的区域,找到不在原始对象中的凸包部分,等等。

我没有看到 Gnu Plot 实际上将我可以使用的任何数据返回给我。如果我错了,一定要告诉我怎么做。谢谢。

0 投票
1 回答
532 浏览

math - 八度中的 Mathematica 表格和修改?

我怎样才能做数学风格

在八度?

0 投票
1 回答
3703 浏览

matplotlib - 八度颜色条和单位

GNU Octave中,您可以制作一张图片,其中不同的颜色代表矩阵中的不同值。您还可以添加一个颜色条,它显示什么颜色对应什么值。

是否可以以某种方式将单位添加到颜色栏中显示的值?不是说“0.36”而是说“0.36 V/nm”?我知道这在 Matlab 中是可能的,但我不知道如何在 Octave 中做到这一点。有什么好的解决方法吗?

我假设这里有人会提到我应该改用 matplotlib(这通常会发生)。你将如何用它来完成同样的事情?