Questions tagged [octave]

GNU Octave is a free and open-source mathematical software package and scripting language. The scripting language is intended to be compatible with MATLAB, but the two packages are not interchangeable. Don’t use both the [matlab] and [octave] tags, unless the question is explicitly about the similarities or differences between the two.

Filter by
Sorted by
Tagged with
285votes
9answers
242kviews

Differences between Octave and MATLAB [closed]

I'm a programmer who knows Python, Ruby and some C who is trying to decide whether to learn GNU Octave or MATLAB. I know that they have a lot in common, but it isn't clear to me how similar the syntax ...
user avatar
  • 3,044
139votes
15answers
77kviews

Octave-Gnuplot-AquaTerm error: set terminal aqua enhanced title "Figure 1"...unknown terminal type"

I've installed Octave and gnuplot via Homebrew, and downloaded AquaTerm.dmg. When I try to plot, I get the following message: octave:4> plot(x,y) gnuplot> set terminal aqua enhanced title "...
user avatar
  • 3,169
95votes
3answers
55kviews

Octave / Matlab: Extend a vector making it repeat itself?

Is there a way to extend a vector by making it repeat itself? >v = [1 2]; >v10 = v x 5; %x represents some function. Something like "1 2" x 5 in perl Then v10 would be: >v10 1 2 1 2 1 ...
user avatar
  • 41.5k
91votes
2answers
44kviews

cocktail party algorithm SVD implementation ... in one line of code?

In a slide within the introductory lecture on machine learning by Stanford's Andrew Ng at Coursera, he gives the following one line Octave solution to the cocktail party problem given the audio ...
user avatar
  • 2,550
85votes
11answers
41kviews

Why/when should I prefer MATLAB over Octave?

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, ...
user avatar
  • 33.1k
82votes
6answers
188kviews

How to concat string + i?

for i=1:N f(i) = 'f'+i; end gives an error in MatLab. What's the correct syntax to initialize an array with N strings of the pattern fi? It seems like even this is not working: for i=1:4 f(i) =...
user avatar
  • 10k
76votes
3answers
159kviews

Octave/Matlab: Adding new elements to a vector

Having a vector x and I have to add an element (newElem) . Is there any difference between - x(end+1) = newElem; and x = [x newElem]; ?
user avatar
  • 9,918
74votes
10answers
88kviews

Plot window not responding

I'm using Windows 7 64 bit. Each time, I'm using plot function, plot windows will shows and draws successfully, but after that it stops responding and must shut down it. For example : x = linspace(0,...
user avatar
  • 28.3k
73votes
31answers
32kviews

What is your favourite MATLAB/Octave programming trick? [closed]

I think everyone would agree that the MATLAB language is not pretty, or particularly consistent. But nevermind! We still have to use it to get things done. What are your favourite tricks for making ...
66votes
7answers
73kviews

How to insert a column/row of ones into a matrix?

Suppose that we have a 3x3 matrix like b = 2 * eye(3); ans = 2 0 0 0 2 0 0 0 2 and I want to a 3x4 matrix like 1 2 0 0 1 0 2 0 1 0 0 2 What is the best way to get ...
user avatar
  • 17.7k
65votes
8answers
42kviews

Octave does not plot

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 ^ ...
user avatar
57votes
10answers
65kviews

Cost Function, Linear Regression, trying to avoid hard coding theta. Octave.

I'm in the second week of Professor Andrew Ng's Machine Learning course through Coursera. We're working on linear regression and right now I'm dealing with coding the cost function. The code I've ...
user avatar
55votes
4answers
43kviews

Remove a column from a matrix in GNU Octave

In GNU Octave, I want to be able to remove specific columns from a matrix. In the interest of generality. I also want to be able to remove specific rows from a matrix. Suppose I have this: ...
user avatar
54votes
8answers
47kviews

Octave : logistic regression : difference between fmincg and fminunc

I often use fminunc for a logistic regression problem. I have read on web that Andrew Ng uses fmincg instead of fminunc, with same arguments. The results are different, and often fmincg is more ...
user avatar
  • 28.3k
52votes
4answers
41kviews

.m files as MATLAB/Octave for Sublime Text

Sublime sees .m files as Objective C files. I've been given a bunch of MATLAB/Octave files to work with using Octave, all with .m extensions. If I change the extensions to .matlab, then Sublime ...
user avatar
  • 3,255

15 30 50 per page
1
2 3 4 5
338