octave

How do you open .mat files in Octave?

痴心易碎 提交于 2019-11-30 08:28:55
I have a ".mat" file that I want to open and see the contents of. Since I don't have MATLAB, I downloaded GNU's Octave. Since I'm working on Mac's TERMINAL, I'm not exactly sure how to open the ".mat" file so that I can see the contents. Can anyone help me with this? Thanks! Not sure which version of .mat file you might have, or whether Octave keeps up with the latest Matlab formats. Here's a link that might be a good start . Bottom line is that you can say: load MyMatFile.mat right at the Octave prompt. In case you wind up having to write code to read the .mat file ever: I've done this before

How do I read a delimited file with strings/numbers with Octave?

倾然丶 夕夏残阳落幕 提交于 2019-11-30 08:24:38
I am trying to read a text file containing digits and strings using Octave. The file format is something like this: A B C a 10 100 b 20 200 c 30 300 d 40 400 e 50 500 but the delimiter can be space, tab, comma or semicolon. The textread function works fine if the delimiter is space/tab: [A,B,C] = textread ('test.dat','%s %d %d','headerlines',1) However it does not work if delimiter is comma/semicolon. I tried to use dklmread: dlmread ('test.dat',';',1,0) but it does not work because the first column is a string. Basically, with textread I can't specify the delimiter and with dlmread I can't

How can I get a list of all the defined variables in Matlab or Octave?

我的未来我决定 提交于 2019-11-30 07:58:26
I'm used to working in Matlab using its full GUI environment. Due to license issues I went and installed Octave, but it appears that it doesn't have a GUI, at least not one that's installed by default. I transferred the variables from Matlab to Octave by save ing them in Matlab and load ing them in Octave. Thing is, I don't remember the names because I got used to seeing them in the little workspace window which I no longer have. How can I see the list of defined variables and their types in Octave? Alexander Torstling The command whos will do just that. You can use a GUI similar to Matlab,

Is the Julia language really as fast as it claims?

大城市里の小女人 提交于 2019-11-30 05:36:31
Following this post I decided to benchmark Julia against GNU Octave and the results were inconsistent with the speed-ups illustrated in julialang.org . I compiled both Julia and GNU Octave with CXXFLAGS='-std=c++11 -O3' , the results I got: GNU Octave a=0.9999; tic;y=a.^(1:10000);toc Elapsed time is 0.000159025 seconds. tic;y=a.^(1:10000);toc Elapsed time is 0.000162125 seconds. tic;y=a.^(1:10000);toc Elapsed time is 0.000159979 seconds. -- tic;y=cumprod(ones(1,10000)*a);toc Elapsed time is 0.000280142 seconds. tic;y=cumprod(ones(1,10000)*a);toc Elapsed time is 0.000280142 seconds. tic;y

How to graph adjacency matrix using MATLAB

拥有回忆 提交于 2019-11-30 04:20:47
问题 I want to create a plot showing connections between nodes from an adjacency matrix like the one below. gplot seems like the best tool for this. However, in order to use it, I need to pass the coordinate of each node. The problem is that I don't know where the coordinates should be, I was hoping the function would be capable of figuring out a good layout for me. For example here's my output using the following arbitrary coordinates: A = [1 1 0 0 1 0; 1 0 1 0 1 0; 0 1 0 1 0 0; 0 0 1 0 1 1; 1 1

Why is Octave slower than MATLAB?

南笙酒味 提交于 2019-11-30 01:19:28
I have been using Octave and MATLAB for a few projects, and I've come across a few questions. This question Why/when should I prefer MATLAB over Octave? ) answered several, but there is still one lingering... I've read a number of posts/other sources comparing performance of Octave and MATLAB, and I've run some of my own tests on standard scripts that confirm the general consensus that Octave is generally much slower than MATLAB for standard operations (iterated, of course, so that the comparison is meaningful). The consensus also seems to suggest that most of MATLAB's performance boost is

Why/when should I prefer MATLAB over Octave?

浪尽此生 提交于 2019-11-29 21:10:47
In our shoestring operation we need to prototype algorithms in some higher-level language before committing to a C implementation on embedded hardware. So far we have been using MATLAB to do that, but the licensing costs are beginning to hurt. We're considering porting our MATLAB code to Octave. Is there any particular reason not to do that? Will we break any compatibility, especially if we have external partners who insist on using MATLAB? Are there any performance penalties we can expect? carlosdc In 2008 I tried doing the same thing. I quickly noticed the following show stoppers: Toolboxes

fminunc alternate in numpy

 ̄綄美尐妖づ 提交于 2019-11-29 20:38:59
Is there an alternative to the fminunc function (from octave/matlab) in python? I have a cost function for a binary classifier. Now I want to run gradient descent to get minimum value of theta. The octave/matlab implementation will look like this. % Set options for fminunc options = optimset('GradObj', 'on', 'MaxIter', 400); % Run fminunc to obtain the optimal theta % This function will return theta and the cost [theta, cost] = ... fminunc(@(t)(costFunction(t, X, y)), initial_theta, options); I have converted my costFunction in python using numpy library, and looking for the fminunc or any

how to compile lapack so that it can be used correctly during installation of octave?

六眼飞鱼酱① 提交于 2019-11-29 19:47:02
问题 I'm trying to install the latest octave 3.8.1 from source in a cluster running redhat+IBM LSF. I don't have write access to anywhere else except my own home dir, that's why I have to install octave from source. The blas and lapack provided by the cluster does not work so I have to build them by myself. I have now finished compiling both blas and lapack and passed the ./configure , but when I run make, an error is reported as follows: These are steps I used to build my own BLAS and LAPACK .

Octave does not plot

南笙酒味 提交于 2019-11-29 18:56:52
When I try to plot a graph on GNU Octave, and try to use plot, it gives me the following output set terminal aqua enhanced title "Figure 1" size 560 420 font "*,6" dashlength 1 ^ line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list I am using Mac OS X 10.9.2. I have tried using octave:79> setenv("GNUTERM","X11") but I still get the same error. Cheng Long setenv("GNUTERM","qt") in your octave command prompt, it should solve the problem. I think your problem comes from using the CLI. As of January 2, 2014. If you're using OS/X 10.9 (Maverics) then you can opt to use