我尝试使用Octave的optim package作为Matlab的替代品(尽可能)。我安装了发行版Octave MinGW和Octave MSVC。
pkg install parallel-2.2.0.tar.gz
在使用 MSVC 版本sh.exe: ./configure: /bin/sh: bad interpreter: No such file or directory
时出现以下错误。
所以我尝试了 MinGW 版本。在安装了all packages(general,struct,miscellaneous,parallel和optim)并输入help linprog
后,我结束了用:
error: help: Octave does not currently provide linprog. Linear programming problems
may be solved using `glpk'. Try `help glpk' for more info.
Please read `http://www.octave.org/missing.html' to learn how you can
contribute missing functionality.
在记录here时使用此功能需要做什么?
我按照 carandraug 的建议尝试了version 3.8.1,但parallel
的安装将与sclose.cc:37:24: fatal error: sys/socket.h: No such file or directory
一起中止。我可以在修复此问题后添加另一个更新。顺便说一句,我希望Octave开发人员将来会选择Eclipse IDE作为默认的Developer-GUI,这样许多人都可以从头开始做出贡献。
以上链接的软件包比Octave 8.3.1附带的软件包更新,因此我只需切换到src
文件夹并运行build_packages
。
答案 0 :(得分:2)
我刚刚在另一个问题上发布了这个答案:
问题是你没有加载optim包。键入pkg list
时,您可以在名称前面找到由星号加载的文件。使用pkg load optim
加载包。
必须加载包是很多用户来自Matlab的东西,但是如果你与其他语言比较,比如Python,Perl或C ++,你会期望它们import
,{{1默认情况下系统中可用的每个库,或use
?有关详细信息,请参阅Octave's FAQ。
如果您希望默认情况下自动加载程序包,建议的操作是将行#include
添加到pkg load optim
文件中。
最后,你刚开始使用Octave,你应该安装Octave 3.8.1。