Wednesday, November 30, 2011

Solve Save Figure Problem On Octave (Ubuntu and Mac)

When I use the "print" command on GNU Octave to save figure/plot I got the following error. The errors were occurred in both Ubuntu 11.10 and Mac OS X.

Warning: query
error: value on right hand side of assignment is undefined
error: `tmp' undefined near line 57 column 11
error: evaluating argument list element number 1
error: evaluating argument list element number 1
error: called from:
error:   /usr/share/octave/3.2.4/m/strings/cstrcat.m at line 57, column 2
error:   /usr/share/octave/3.2.4/m/plot/print.m at line 707, column 7
The, I ask my friend and he give me the solution. The solution is to comment two lines in cstrcat.m according to the error.
sudo nano /usr/share/octave/3.2.4/m/strings/cstrcat.m
 Find the following line,

tmp = warning ("query", "Octave:empty-list-elements")
.
.
.
warning (tmp.state, "Octave:empty-list-elements"
Comment both lines above, so it becomes like this,
%tmp = warning ("query", "Octave:empty-list-elements")
.
.
.
%warning (tmp.state, "Octave:empty-list-elements"

Finish. Exit from your octave and enter octave again. Try to save plot such as the following command,
print picture.eps
 That's work for me. Let's try!