문제

I try to use Octave's optim package as a replacement (as far as possible) for Matlab. I installed both distros Octave MinGW and Octave MSVC.

pkg install parallel-2.2.0.tar.gz gives me the following error in case of using the MSVC version sh.exe: ./configure: /bin/sh: bad interpreter: No such file or directory. So I tried the MinGW version. After installing all packages (general, struct, miscellaneous, parallel and optim) being required and typing help linprog I ended up with:

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.

What needs to be done to use this function as documented here?

Update1

I tried version 3.8.1 as suggested by carandraug but the installation of parallel will abort with sclose.cc:37:24: fatal error: sys/socket.h: No such file or directory. I may add another update after fixing this. By the way I hope the Octave developer will choose an Eclipse IDE as the default Developer-GUI in the future so something that many, many people can contribute to without starting from scratch.

Update2

The above linked packages are newer than those being shipped with Octave 8.3.1 so I simply switched to the src folder and ran build_packages.

도움이 되었습니까?

해결책

I just posted this answer on a separate question:

The problem is that you didn't load the optim package. When you type pkg list you can find which ones are loaded by an asterisk in front of their names. Load a package with pkg load optim.

Having to load a packages is that thing that many users coming from Matlab find strange but if you compare with other languages, such as Python, Perl, or C++, would you expect them to import, use, or #include every libraries available in the system by default? See Octave's FAQ for more details.

If you want a package to be loaded automatically by default, the recommended action is to add the line pkg load optim to your ~/.octaverc file.

Finally, you have just started with Octave, you should probably have installed Octave 3.8.1.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top